-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Workflow for PR run checks to manage secret usage (#71)
* Workflow for PR run checks to manage secret usage * Use full permission check * Make check-run only for workflow calls and scan on targets * Check target * Preliminary needs * Keep target removed * Temporarily open up * Revert "Temporarily open up" This reverts commit 24c4e28. * Always run check * Allow PRs again, and check only on targets * Incremental for both PR events * Do not skip * Removal for final testing post-merge
- Loading branch information
1 parent
7e191c1
commit 5902526
Showing
2 changed files
with
41 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Check PR run | ||
|
||
on: | ||
workflow_call: | ||
|
||
permissions: read-all | ||
|
||
jobs: | ||
check: | ||
name: Check | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- name: Get user permission | ||
id: get-permission | ||
uses: actions-cool/check-user-permission@956b2e73cdfe3bcb819bb7225e490cb3b18fd76e # v2.2.1 | ||
with: | ||
require: write | ||
username: ${{ github.triggering_actor }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Check user permission | ||
if: steps.get-permission.outputs.require-result == 'false' | ||
run: | | ||
echo "User ${{ github.triggering_actor }} does not have the necessary access for this repository." | ||
echo "Current permission level is ${{ steps.get-permission.outputs.user-permission }}." | ||
echo "Job originally triggered by ${{ github.actor }}." | ||
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters