Skip to content

Commit 943e9a0

Browse files
committed
feat: make action test itself
1 parent 17d74fa commit 943e9a0

2 files changed

Lines changed: 13 additions & 21 deletions

File tree

.github/workflows/test_action.yaml

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,8 @@ jobs:
1010
uses: actions/checkout@v4
1111
- name: Generate version data using local action
1212
uses: ./
13-
- name: Check file contents
14-
run: |
15-
printf "Contents of chart.md:\n"
16-
cat chart.md
17-
printf "\n\n"
18-
printf "Contents of schedule.json:\n"
19-
cat schedule.json
20-
printf "\n\n"
21-
printf "Contents of schedule.md:\n"
22-
cat schedule.md
23-
printf "\n\n"
24-
- name: Remove generated files
25-
run: |
26-
printf "Removing generated files...\n"
27-
rm -f chart.md schedule.json schedule.md
28-
ls -R
29-
- uses: actions/download-artifact@v5
30-
with:
31-
name: spec-zero-versions
32-
- name: Display structure of downloaded files
33-
run: ls -R
13+
with:
14+
project_file_name: tests/test_data/pyproject.toml
15+
create_pr: false
16+
schedule_path: tests/test_data/test_schedule.json
17+

action.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ inputs:
1010
description: "The filename to the project file that lists your dependencies, relative to the repository root. Defaults to 'pyproject.toml' Curretnly only pyproject.toml is supported but others may be added."
1111
required: true
1212
default: "pyproject.toml"
13+
create_pr:
14+
description: "Whether the action should open a PR or not. If this is set to false, this action should have no effect. This is mainly useful for testing"
15+
required: true
16+
default: true
17+
schedule_path:
18+
description: "Path to the schedule.json file. If it does not exist yet, it will be downloaded from the spec0-action repository latest release"
19+
default: schedule.json
1320
token:
1421
description: "GitHub token with repo permissions to create pull requests"
1522
required: true
@@ -50,6 +57,7 @@ runs:
5057
5158
5259
- name: Create Pull Request
60+
if: ${{inputs.create_pr }}
5361
uses: peter-evans/create-pull-request@v6
5462
with:
5563
token: ${{ inputs.token }}

0 commit comments

Comments
 (0)