Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 16 additions & 31 deletions .github/workflows/pr-audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ on:
pull_request:
types: [labeled]

permissions:
contents: read
permissions: {}

jobs:
publish:
authorize:
if: github.event.label.name == 'cyclops'
runs-on: ubuntu-latest
if: github.event.action == 'labeled' && github.event.label.name == 'cyclops'
permissions:
contents: read
steps:
- name: Check admin permission
env:
Expand All @@ -24,30 +25,14 @@ jobs:
exit 1
fi

- name: Publish event
env:
EVENTS_KEY: ${{ secrets.EVENTS_KEY }}
EVENTS_CERT: ${{ secrets.EVENTS_CERT }}
EVENTS_ARGS: ${{ secrets.EVENTS_ARGS }}
REPOSITORY: ${{ github.repository }}
PR_NUMBER: ${{ github.event.pull_request.number }}
PR_SHA: ${{ github.event.pull_request.head.sha }}
run: |
set -euo pipefail

echo "$EVENTS_KEY" > "$RUNNER_TEMP/key"
echo "$EVENTS_CERT" > "$RUNNER_TEMP/cert"

read -r -a events_args <<< "${EVENTS_ARGS:-}"
curl -sf -o /dev/null -X POST "${events_args[@]}" \
-H "Content-Type: application/json" \
--key "$RUNNER_TEMP/key" \
--cert "$RUNNER_TEMP/cert" \
-d "{
\"repository\": \"${REPOSITORY}\",
\"event\": \"pr_audit\",
\"data\": {
\"pr_number\": ${PR_NUMBER},
\"sha\": \"${PR_SHA}\"
}
}"
pr-audit:
needs: authorize
permissions:
contents: read
Comment thread
mablr marked this conversation as resolved.
pull-requests: read
statuses: write
uses: tempoxyz/gh-actions/.github/workflows/pr-audit.yml@183a02178c660ce295e9a262edc5857cb7135f06
secrets:
EVENTS_KEY: ${{ secrets.EVENTS_KEY }}
EVENTS_CERT: ${{ secrets.EVENTS_CERT }}
EVENTS_ARGS: ${{ secrets.EVENTS_ARGS }}
8 changes: 8 additions & 0 deletions .pinact.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 3

rules:
# tempoxyz/gh-actions has no release version to record in a comment.
- ignore: true
conditions:
- expr: |
ActionName matches "tempoxyz/gh-actions/.*"