-
Notifications
You must be signed in to change notification settings - Fork 409
78 lines (67 loc) · 1.76 KB
/
branch.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#
# Workflow: Build Branch
#
name: Build Branch
on: push
jobs:
ensure-repo:
name: "Ensure Repository"
runs-on: ubuntu-latest
if: github.repository == 'zpqrtbnk/test-repo'
steps:
- name: Report
shell: bash
run: echo "Repository is ${{ github.repository }}"
build:
name: "Build Branch"
runs-on: ubuntu-latest
needs: ensure-repo
steps:
- name: Step
shell: bash
run: |
echo "Branch"
if [ -z "${{ secrets.SOME_SECRET_TOKEN }}" ]; then
echo "SECRET IS ABSENT"
else
echo "SECRET IS PRESENT"
fi
create-artifact:
runs-on: ubuntu-latest
needs: build
steps:
- run: mkdir -p path/to/artifact
- run: echo "hello" > path/to/artifact/world.txt
- uses: actions/upload-artifact@master
with:
name: my-artifact
path: path/to/artifact
list-artifacts:
runs-on: ubuntu-latest
needs: create-artifact
steps:
- uses: actions/github-script@v6
with:
script: |
const restapi = github.rest
var artifacts = await restapi.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{ github.run_id }},
});
console.log(artifacts)
get-artifact:
runs-on: ubuntu-latest
needs: create-artifact
steps:
- uses: actions/download-artifact@master
with:
name: my-artifact
path: path/to/artifact
- run: cat path/to/artifact/world.txt
# build-call:
#
# name: "Call"
# needs: build
# uses: ./.github/workflows/callme.yml
# secrets: inherit