Skip to content

Commit 8b5cc97

Browse files
Refactor Github Action per b/485167538 (firebase#596)
Co-authored-by: Ben Knutson <benknutson@google.com>
1 parent 5d91871 commit 8b5cc97

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

.github/workflows/issue-labels.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,16 @@ jobs:
1616
- name: Check if the comment is from the OP
1717
id: check-op
1818
run: |
19-
OP=${{ github.event.issue.user.login }}
20-
COMMENTER=${{ github.event.comment.user.login }}
19+
OP=${GITHUB_EVENT_ISSUE_USER_LOGIN}
20+
COMMENTER=${GITHUB_EVENT_COMMENT_USER_LOGIN}
2121
if [ "$OP" = "$COMMENTER" ]; then
2222
echo "op_comment=true" >> $GITHUB_ENV
2323
else
2424
echo "op_comment=false" >> $GITHUB_ENV
2525
fi
26+
env:
27+
GITHUB_EVENT_ISSUE_USER_LOGIN: ${{ github.event.issue.user.login }}
28+
GITHUB_EVENT_COMMENT_USER_LOGIN: ${{ github.event.comment.user.login }}
2629
- name: Add 'Needs Attention' label if OP responded
2730
if: env.op_comment == 'true'
2831
uses: actions-ecosystem/action-add-labels@v1
@@ -48,4 +51,4 @@ jobs:
4851
with:
4952
labels: 'Needs Attention'
5053
env:
51-
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
54+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

.github/workflows/unit_tests.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,18 @@ jobs:
5757
if: matrix.target == 'html'
5858
run: |
5959
melos exec \
60-
--scope=${{ matrix.package }}* \
60+
--scope=${MATRIX_PACKAGE}* \
6161
--dir-exists="test" \
6262
--fail-fast -- "flutter test --platform chrome"
63+
env:
64+
MATRIX_PACKAGE: ${{ matrix.package }}
6365

6466
- name: Run unit tests
6567
if: matrix.target == 'io'
6668
run: |
6769
melos exec \
68-
--scope=${{ matrix.package }}* \
70+
--scope=${MATRIX_PACKAGE}* \
6971
--dir-exists="test" \
7072
--fail-fast -- "flutter test"
73+
env:
74+
MATRIX_PACKAGE: ${{ matrix.package }}

0 commit comments

Comments
 (0)