Skip to content

Commit e01fcae

Browse files
committed
Test the action's default version, not a copy of it
The Follow open-java-format releases workflow pushes with its own token, and GitHub refuses such a push when it changes a workflow file: its first run failed with "refusing to allow a GitHub App to create or update workflow .github/workflows/ci.yml without workflows permission". So Test Action no longer passes a version. Its steps run the action with the default from action.yml, which is the version that gets bumped, so that is what the tests should exercise anyway.
1 parent 6e1a02b commit e01fcae

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
pull_request:
66
workflow_dispatch: # Follow open-java-format releases runs this on the bump it pushes
77

8+
# No version input anywhere here: the tests run the action with its default, the version that Follow
9+
# open-java-format releases bumps. That workflow pushes with its own token, which may not change a
10+
# workflow file, so the version must not be written in this one.
811
jobs:
912
test-changed:
1013
name: Test mode=changed
@@ -15,7 +18,6 @@ jobs:
1518
fetch-depth: 0
1619
- uses: ./
1720
with:
18-
version: '2.98.0.5'
1921
mode: changed
2022

2123
# The action and the hook on every platform they support, with a file that is formatted and one that
@@ -39,7 +41,6 @@ jobs:
3941
- name: Check it
4042
uses: ./
4143
with:
42-
version: '2.98.0.5'
4344
mode: all
4445

4546
- name: Write a file that is not formatted
@@ -50,7 +51,6 @@ jobs:
5051
continue-on-error: true
5152
uses: ./
5253
with:
53-
version: '2.98.0.5'
5454
mode: all
5555

5656
- name: Make sure the check failed

‎.github/workflows/follow-releases.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Follow open-java-format releases
22

3-
# The action, the pre-commit hook, the CI and the README name one open-java-format version, and
3+
# The action, the pre-commit hook and the README name one open-java-format version, and
44
# .open-java-format-version holds it. Once an hour this compares that file with the latest release of
55
# openjavaformat/open-java-format. When a new release is out, the version is replaced in every file
66
# that names it, the result is pushed to main, and Test Action is run on it. That run has to be
@@ -49,7 +49,7 @@ jobs:
4949
git commit --all --quiet --file - <<COMMIT
5050
Check with open-java-format $latest
5151
52-
The action, the pre-commit hook and the CI default to $latest, which
52+
The action and the pre-commit hook default to $latest, which
5353
openjavaformat/open-java-format released on $published. Made by the
5454
"$GITHUB_WORKFLOW" workflow:
5555
$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID

0 commit comments

Comments
 (0)