Skip to content

Commit

Permalink
Merge pull request #11 from ajschmidt8/add-rapids-is-stable-build
Browse files Browse the repository at this point in the history
Add `rapids-is-stable-build` and permissions checker
  • Loading branch information
ajschmidt8 authored Sep 21, 2022
2 parents 28a0cf8 + fbb34fb commit 4c3df34
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
26 changes: 25 additions & 1 deletion .github/workflows/prs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ on:
paths:
- "tools/*"

defaults:
run:
shell: bash

jobs:
shellcheck:
checks:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -15,3 +19,23 @@ jobs:
uses: ludeeus/action-shellcheck@master
with:
scandir: "./tools"
- name: Check Permissions
run: |
# Executable bit indices
USER_EXEC_IND=3
GROUP_EXEC_IND=6
ELSE_EXEC_IND=9
for FILE in tools/*; do
PERMISSIONS=$(stat -c "%A" "${FILE}")
for IND in "${USER_EXEC_IND}" "${GROUP_EXEC_IND}" "${ELSE_EXEC_IND}"; do
EXEC_PERM="${PERMISSIONS:$IND:1}"
if [ "${EXEC_PERM}" != "x" ]; then
ls -l tools/
echo ""
echo "${FILE} does not have the correct permissions."
echo "Ensure are tools are executable by everyone and try again."
exit 1
fi
done
done
14 changes: 14 additions & 0 deletions tools/rapids-is-stable-build
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
# A utility script that examines environment variables provided by
# GitHub Actions to determine whether the current build is a "stable" build.
# A "stable" build occurs when the GITHUB_REF environment variable matches
# the pattern "refs/tags/vYY.MM.PP".
# Example:
# if ./tools/rapids-is-stable-build; then echo "hi"; fi
set -e

if [[ "${GITHUB_REF}" =~ ^refs/tags/v[0-9]{2}.[0-9]{2}.[0-9]{2}$ ]]; then
exit 0
fi

exit 1

0 comments on commit 4c3df34

Please sign in to comment.