Skip to content

Commit debe760

Browse files
committed
Fix publish conditional
The top-level `env` is not available as an `env` context directly, and apparently jobs outputs is the best way to do this.
1 parent 8b2554f commit debe760

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

.github/workflows/docs.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
1+
---
12
name: Docs
23

34
on: [push, pull_request]
45

5-
env:
6-
IS_RELEASE: |
7-
${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
8-
96
jobs:
107
build:
118
runs-on: ubuntu-20.04
129
steps:
10+
- name: Check if release
11+
id: setup
12+
run: |
13+
echo "IS_RELEASE=${{
14+
github.event_name == 'push' && github.ref == 'refs/heads/main'
15+
}}" >> $GITHUB_OUTPUT
16+
1317
- uses: actions/checkout@v2
1418

1519
- name: Upgrade jinja
@@ -20,13 +24,13 @@ jobs:
2024

2125
- name: Build
2226
run: |
23-
if [ "x$IS_RELEASE" == "xtrue" ]; then
27+
if [ "${{ steps.setup.outputs.IS_RELEASE }}" == "true" ]; then
2428
O="-t release"
2529
fi
2630
make html O="$O"
2731
2832
- name: Publish
29-
if: ${{ env.IS_RELEASE == 'true' }}
33+
if: ${{ steps.setup.outputs.IS_RELEASE == 'true' }}
3034
uses: peaceiris/actions-gh-pages@v3
3135
with:
3236
github_token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)