Skip to content

Commit

Permalink
Move PR run check from template (#263)
Browse files Browse the repository at this point in the history
  • Loading branch information
withinfocus committed Mar 8, 2024
1 parent 4a07a79 commit 114fe4e
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/check-run.yml
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

0 comments on commit 114fe4e

Please sign in to comment.