-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (72 loc) · 2.3 KB
/
env.yml
File metadata and controls
82 lines (72 loc) · 2.3 KB
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
79
80
81
82
name: ENV Variables
on: push
env:
WF_ENV: ${{ secrets.WF_ENV}}
jobs:
decrypt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Decrypt files
env:
PASSPHRASE: ${{ secrets.PASSPHRASE}}
run : gpg --quiet --batch --yes --decrypt --passphrase="$PASSPHRASE" --output $HOME/secrets.json secrets.json.gpg
- name: Print our file content
run: cat $HOME/secrets.json
create_commit:
runs-on: ubuntu-latest
steps:
- name: Push a random file
run: |
pwd
ls -a
git init
git remote add origin "https://$GITHUB_ACTOR:${{secrets.GITHUB_TOKEN}}@github.com/$GITHUB_REPOSITORY.git"
git config --global user.email "bot@example.com"
git config --global user.name "bot"
git fetch
git checkout master
git branch --set-upstream-to=origin/master
git pull
ls -a
echo $RANDOM >> random.txt
ls -a
git add -A
git commit -m "Random file"
git push
- name: Create issue using REST API
run: |
curl --request POST \
--url https://api.github.com/repos/${{ github.repository }}/issues \
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
--header 'content-type: application/json' \
--data '{
"title": "Automated issue for commit: ${{ github.sha }}",
"body": "This issue was automatically created by the GitHub Action workflow **${{ github.workflow }}**. \n\n The commit hash was: _${{ github.sha }}_."
}' \
--fail
log-env:
runs-on: ubuntu-latest
env:
JOB_ENV: Available to all steps in log-env job
steps:
- name: Log Env Variables
env:
STEP_ENV: Available to only this step
run: |
echo "WF_ENV: ${WF_ENV}"
echo "JOB_ENV: ${JOB_ENV}"
echo "STEP_ENV: ${STEP_ENV}"
- name: Log Env 2
run: |
echo "WF_ENV: ${WF_ENV}"
echo "JOB_ENV: ${JOB_ENV}"
echo "STEP_ENV: ${STEP_ENV}"
log-default-env:
runs-on: ubuntu-latest
steps:
- name: Default ENV Variables
run: |
echo "HOME: ${HOME}"
echo "GITHUB_WORKFLOW: ${GITHUB_WORKFLOW}"
echo "GITHUB_ACTION: ${GITHUB_ACTION}"