Skip to content

Document reorder-apps from tockloader #121

Document reorder-apps from tockloader

Document reorder-apps from tockloader #121

Workflow file for this run

name: sha-checker
on:
pull_request:
types: [labeled, unlabeled, opened, reopened, synchronize]
workflow_dispatch:
jobs:
check:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Check if files included in appropriately labeled PRs
run: |
# Get PR number
PR_NO=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")
echo "PR number: $PR_NO"
# Get PR labels
labels="$(gh api repos/${DOWNSTREAM}/pulls/$PR_NO --jq '.labels.[].name')"
echo "$labels"
# Check for exclusive label to continue operations
if [[ $labels =~ (EXCLUSIVE LABEL) ]]; then
echo "Label found. Continuing..."
else
echo "Label not found. No sha-checker needed."
exit 0
fi
# Get changed files
files="$(gh pr view "$PR_NO" --json files -q '.files[].path')"
echo "$files"
# Check if '.lastcommsha' among changed files
if [[ $files =~ (.lastcommsha) ]]; then
echo "File found."
exit 0
else
echo "File not found. Please make sure you update the sha within '.lastcommsha'."
exit 1
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
UPSTREAM: "tock/tock"
DOWNSTREAM: ${{ github.repository }}