-
Notifications
You must be signed in to change notification settings - Fork 1
39 lines (35 loc) · 1.03 KB
/
envvar.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
name: envvar
on:
pull_request:
types:
- opened # default
- synchronize # default
- reopened # default
- ready_for_review # draft -> ready
jobs:
first:
env:
NAMESPACE: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4
- name: Set env ${{ env.NAMESPACE }}
id: first-job
run: |
echo "TEST=TEST_VALUE" >> "$GITHUB_ENV"
echo "TEST=TEST_VALUE" >> "$GITHUB_OUTPUT"
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4
- name: Get env
run: |
echo ${{ env.TEST }}
echo ${{ steps.first-job.outputs.TEST }}
second:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4
- name: Get env
run: |
echo "${{ env.TEST }}"
echo "$GITHUB_REF"
PR_NUMBER=$(echo "$GITHUB_REF" | awk 'BEGIN { FS = "/" } ; { print $3 }')
echo "PR: $PR_NUMBER"