Skip to content

Commit a81ee4a

Browse files
author
jhudsl-robot
committed
🔄 Synced local '.github/workflows/' with remote '.github/workflows/'
release-renderAction
1 parent 27fb0e7 commit a81ee4a

File tree

5 files changed

+400
-236
lines changed

5 files changed

+400
-236
lines changed

.github/workflows/check-url-2.yml

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
name: Periodic URL Check 2
2+
3+
4+
on:
5+
workflow_dispatch:
6+
schedule:
7+
- cron: '0 0 1 * *'
8+
9+
jobs:
10+
set-up:
11+
name: Load user automation choices
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v3
16+
with:
17+
fetch-depth: 0
18+
19+
# Use the yaml-env-action action.
20+
- name: Load environment from YAML
21+
uses: doughepi/[email protected]
22+
with:
23+
files: config_automation.yml # Pass a space-separated list of configuration files. Rightmost files take precedence.
24+
outputs:
25+
toggle_url_check_periodically: "${{ env.URL_CHECK_PERIODICALLY }}"
26+
27+
url-check:
28+
name: Check URLs
29+
needs: set-up
30+
if: ${{needs.set-up.outputs.toggle_url_check_periodically == 'true'}}
31+
runs-on: ubuntu-latest
32+
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v3
36+
with:
37+
fetch-depth: 0
38+
39+
# Delete the branch if this has been run before
40+
- name: Delete branch locally and remotely
41+
run: git push origin --delete preview-spell-error || echo "No branch to delete"
42+
43+
# Make the branch fresh
44+
- name: Make the branch fresh
45+
run: |
46+
git config --global --add safe.directory $GITHUB_WORKSPACE
47+
git config --global user.name 'github-actions[bot]'
48+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
49+
50+
echo branch doesnt exist
51+
git checkout -b preview-spell-error || echo branch exists
52+
git push --set-upstream origin preview-spell-error || echo echo branch exists remotely
53+
shell: bash
54+
55+
- name: Run the check
56+
uses: ottrproject/ottr-reports@main
57+
id: check_results
58+
continue-on-error: true
59+
with:
60+
check_spelling: false
61+
spelling_error_min: 1
62+
check_urls: true
63+
url_error_min: 1
64+
check_quiz_form: false
65+
quiz_error_min: 1
66+
sort_dictionary: false
67+
68+
- name: Declare file path and time
69+
id: check-report
70+
run: |
71+
error_num=$(cat check_reports/url_checks.tsv | wc -l)
72+
error_num="$((error_num-1))"
73+
echo "error_num=$error_num" >> $GITHUB_OUTPUT
74+
echo "error_url=https://github.com/${GITHUB_REPOSITORY}/blob/preview-spell-error/check_reports/url_checks.tsv" >> $GITHUB_OUTPUT
75+
shell: bash
76+
77+
- name: Stop if failure
78+
if: steps.check_results.outcome == 'failure'
79+
run: exit 1
80+
81+
- name: Print out error variables
82+
run: |
83+
echo ${{ steps.check-report.outputs.error_url }}
84+
echo ${{ steps.check-report.outputs.error_num }}
85+
86+
# Commit file
87+
- name: Commit tocless bookdown files
88+
if: ${{ steps.check-report.outputs.error_num >= 1 }}
89+
env:
90+
GH_PAT: ${{ secrets.GH_PAT }}
91+
run: |
92+
git add --force check_reports/url_checks.tsv
93+
git commit -m 'Add spell check file' || echo "No changes to commit"
94+
git push --set-upstream origin preview-spell-error || echo echo branch exists remotely
95+
96+
- name: Find issues
97+
id: find-issue
98+
env:
99+
GH_PAT: ${{ secrets.GH_PAT }}
100+
run: |
101+
echo "$GITHUB_REPOSITORY"
102+
curl -o find_issue.R https://raw.githubusercontent.com/ottrproject/ottr-reports/main/scripts/find_issue.R
103+
issue_exists=$(Rscript --vanilla find_issue.R --repo $GITHUB_REPOSITORY --git_pat $GH_PAT)
104+
echo URL issue exists: $issue_exists
105+
echo "issue_existence=$issue_exists" >> $GITHUB_OUTPUT
106+
107+
- name: If too many URL errors, then make an issue
108+
if: ${{ steps.check-report.outputs.error_num >= 1 && steps.find-issue.outputs.issue_existence == 0}}
109+
uses: JasonEtco/create-an-issue@v2
110+
with:
111+
filename: .github/ISSUE_TEMPLATE/url-error.md
112+
env:
113+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
114+
FILE_URL: ${{ steps.check-report.outputs.error_url }}
115+
ERROR_NUM: ${{ steps.check-report.outputs.error_num }}
116+
117+
- name: If no URL errors than delete the branch we made
118+
if: ${{ steps.check-report.outputs.error_num < 1 }}
119+
run: |
120+
git config --system --add safe.directory "$GITHUB_WORKSPACE"
121+
git push origin --delete preview-spell-error || echo "No branch to delete"

.github/workflows/check-url.yml

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
name: Periodic URL Check
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 0 1 * *'
7+
8+
jobs:
9+
set-up:
10+
name: Load user automation choices
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v3
15+
with:
16+
fetch-depth: 0
17+
18+
# Use the yaml-env-action action.
19+
- name: Load environment from YAML
20+
uses: doughepi/[email protected]
21+
with:
22+
files: config_automation.yml # Pass a space-separated list of configuration files. Rightmost files take precedence.
23+
outputs:
24+
toggle_url_check_periodically: "${{ env.URL_CHECK_PERIODICALLY }}"
25+
26+
url-check:
27+
name: Check URLs
28+
needs: set-up
29+
if: ${{needs.set-up.outputs.toggle_url_check_periodically == 'true'}}
30+
runs-on: ubuntu-latest
31+
container:
32+
image: jhudsl/base_ottr:main
33+
34+
steps:
35+
- name: Checkout
36+
uses: actions/checkout@v3
37+
with:
38+
fetch-depth: 0
39+
40+
# Delete the branch if this has been run before
41+
- name: Delete branch locally and remotely
42+
run: git push origin --delete preview-spell-error || echo "No branch to delete"
43+
44+
# Make the branch fresh
45+
- name: Make the branch fresh
46+
run: |
47+
git config --global --add safe.directory $GITHUB_WORKSPACE
48+
git config --global user.name 'github-actions[bot]'
49+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
50+
51+
echo branch doesnt exist
52+
git checkout -b preview-spell-error || echo branch exists
53+
git push --set-upstream origin preview-spell-error || echo echo branch exists remotely
54+
shell: bash
55+
56+
- name: Run the check
57+
uses: ottrproject/ottr-reports@main
58+
id: check_results
59+
continue-on-error: true
60+
with:
61+
check_spelling: false
62+
spelling_error_min: 1
63+
check_urls: true
64+
url_error_min: 1
65+
check_quiz_form: false
66+
quiz_error_min: 1
67+
sort_dictionary: false
68+
69+
- name: Declare file path and time
70+
id: check-report
71+
run: |
72+
error_num=$(cat check_reports/url_checks.tsv | wc -l)
73+
error_num="$((error_num-1))"
74+
echo "error_num=$error_num" >> $GITHUB_OUTPUT
75+
echo "error_url=https://github.com/${GITHUB_REPOSITORY}/blob/preview-spell-error/check_reports/url_checks.tsv" >> $GITHUB_OUTPUT
76+
shell: bash
77+
78+
- name: Stop if failure
79+
if: steps.check_results.outcome == 'failure'
80+
run: exit 1
81+
82+
- name: Print out error variables
83+
run: |
84+
echo ${{ steps.check-report.outputs.error_url }}
85+
echo ${{ steps.check-report.outputs.error_num }}
86+
87+
# Commit file
88+
- name: Commit tocless bookdown files
89+
if: ${{ steps.check-report.outputs.error_num >= 1 }}
90+
env:
91+
GH_PAT: ${{ secrets.GH_PAT }}
92+
run: |
93+
git add --force check_reports/url_checks.tsv
94+
git commit -m 'Add spell check file' || echo "No changes to commit"
95+
git push --set-upstream origin preview-spell-error || echo echo branch exists remotely
96+
97+
- name: Find issues
98+
id: find-issue
99+
env:
100+
GH_PAT: ${{ secrets.GH_PAT }}
101+
run: |
102+
echo "$GITHUB_REPOSITORY"
103+
curl -o find_issue.R https://raw.githubusercontent.com/ottrproject/ottr-reports/main/scripts/find_issue.R
104+
issue_exists=$(Rscript --vanilla find_issue.R --repo $GITHUB_REPOSITORY --git_pat $GH_PAT)
105+
echo URL issue exists: $issue_exists
106+
echo "issue_existence=$issue_exists" >> $GITHUB_OUTPUT
107+
108+
- name: If too many URL errors, then make an issue
109+
if: ${{ steps.check-report.outputs.error_num >= 1 && steps.find-issue.outputs.issue_existence == 0}}
110+
uses: JasonEtco/create-an-issue@v2
111+
with:
112+
filename: .github/ISSUE_TEMPLATE/url-error.md
113+
env:
114+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
115+
FILE_URL: ${{ steps.check-report.outputs.error_url }}
116+
ERROR_NUM: ${{ steps.check-report.outputs.error_num }}
117+
118+
- name: If no URL errors than delete the branch we made
119+
if: ${{ steps.check-report.outputs.error_num < 1 }}
120+
run: |
121+
git config --system --add safe.directory "$GITHUB_WORKSPACE"
122+
git push origin --delete preview-spell-error || echo "No branch to delete"

.github/workflows/delete-preview.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818

1919
# Check out current repository
2020
- name: checkout
21-
uses: actions/checkout@v3
21+
uses: actions/checkout@v4
2222
with:
2323
fetch-depth: 0
2424

0 commit comments

Comments
 (0)