forked from Codex-/return-dispatch
-
Notifications
You must be signed in to change notification settings - Fork 1
36 lines (35 loc) · 1.1 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Trivy Scan
on:
pull_request:
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set target branch
run: echo "TARGET_BRANCH=${{ github.ref }}" >> $GITHUB_ENV
- name: Set target branch for PR event
if: ${{ github.event_name == 'pull_request' }}
run: echo "TARGET_BRANCH=${{ github.event.pull_request.head.ref }}" >> $GITHUB_ENV
- name: Dispatch and return Run ID
id: return_dispatch
uses: ./
with:
token: ${{ secrets.TOKEN }}
ref: ${{ env.TARGET_BRANCH }}
repo: return-dispatch
owner: codex-
workflow: dispatch.yml
workflow_inputs: '{"cake":"delicious"}'
workflow_timeout_seconds: 30
- name: Evaluate that the Run ID output has been set
run: |
if [ "${{ steps.return_dispatch.outputs.run_id }}" == "" ]; then
echo "Failed to return Run ID"
exit 1
fi
- name: Output fetched Run ID
run: echo ${{ steps.return_dispatch.outputs.run_id }}