Skip to content

Commit 3939580

Browse files
authored
Update UpdateReadme.yml
1 parent 9adaaa1 commit 3939580

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

.github/workflows/UpdateReadme.yml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,34 @@ on:
66
workflow_dispatch: # manual trigger
77

88
jobs:
9+
check-template:
10+
runs-on: ubuntu-latest
11+
outputs:
12+
has_template: ${{ steps.check.outputs.has_template }}
13+
steps:
14+
- name: Checkout repo
15+
uses: actions/checkout@v4
16+
17+
- name: Check for README.template.md
18+
id: check
19+
shell: bash
20+
run: |
21+
if [[ -f "README.template.md" ]]; then
22+
echo "has_template=true" >> "$GITHUB_OUTPUT"
23+
else
24+
echo "has_template=false" >> "$GITHUB_OUTPUT"
25+
echo "README.template.md not found. Skipping README update." >&2
26+
fi
27+
928
call-shared:
10-
if: ${{ hashFiles('README.template.md') != '' }} # only run if the file exists
29+
needs: check-template
30+
if: ${{ needs.check-template.outputs.has_template == 'true' }}
1131
uses: control-toolbox/CTActions/.github/workflows/update-readme.yml@main
1232
with:
1333
template_file: README.template.md
1434
output_file: README.md
15-
package_name: CTDirect # package for INSTALL.md
16-
repo_name: CTDirect.jl # repository for CONTRIBUTING.md links
35+
package_name: CTDirect # package for INSTALL.md
36+
repo_name: CTDirect.jl # repository for CONTRIBUTING.md links
1737
citation_badge: "[![DOI](https://zenodo.org/badge/541187171.svg)](https://zenodo.org/doi/10.5281/zenodo.16753152)" # example, can be empty
1838
assignee: "ocots"
1939
secrets: inherit

0 commit comments

Comments
 (0)