generated from actions/javascript-action
-
Notifications
You must be signed in to change notification settings - Fork 10
50 lines (49 loc) · 1.76 KB
/
status.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
on: [status]
jobs:
circleci_artifacts_redirector_status_job:
runs-on: ubuntu-latest
if: "${{ github.event.context == 'ci/circleci: build' }}"
name: CircleCI artifacts redirector status
outputs:
url: ${{ steps.run-circleci-artifacts-redirector.outputs.url }}
steps:
# WARNING!
# This repo uses the action in its own root directory.
# GitHub-action users should not do this!
# See README.md for usage instructions.
- name: Print event data
env:
GITHUB_EVENT: ${{ toJSON(github.event) }}
run: echo "$GITHUB_EVENT"
- name: Print expected ref
run: echo SHA=${{ github.event.sha }}
- name: Checkout repo
uses: actions/checkout@master
with:
ref: ${{ github.event.sha }}
- name: Check history
run: git log -n 1
- name: GitHub Action step
uses: ./
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
api-token: ${{ secrets.CIRCLECI_TOKEN }}
artifact-path: 0/test_artifacts/root_artifact.md
job-title: "See artifact here (status)!"
id: run-circleci-artifacts-redirector
use_outputs_status_job:
runs-on: ubuntu-latest
needs: [circleci_artifacts_redirector_status_job]
name: Use the status output
if: github.event.state != 'pending'
steps:
- name: Checkout repo
uses: actions/checkout@master
with:
ref: ${{ github.event.sha }}
- name: Get expected commit
run: |
echo ${{ needs.circleci_artifacts_redirector_status_job.outputs.url }}
echo ${{ github.event.sha }}
- name: Check the URL
run: curl -L --fail ${{ needs.circleci_artifacts_redirector_status_job.outputs.url }} | grep ${{ github.event.sha }}