Skip to content

ci: replace weekly_ci with periodic_ci, stagger schedules [citest_skip] #1035

ci: replace weekly_ci with periodic_ci, stagger schedules [citest_skip]

ci: replace weekly_ci with periodic_ci, stagger schedules [citest_skip] #1035

---
# yamllint disable rule:line-length
name: Test converting README.md to README.html
on: # yamllint disable-line rule:truthy
pull_request:
types:
- opened
- synchronize
- labeled
issue_comment:
types:
- created
merge_group:
branches:
- main
types:
- checks_requested
push:
branches:
- main
permissions:
contents: read
pull-requests: read
jobs:
test_converting_readme:
if: |
(
github.event_name == 'issue_comment'
&& github.event.issue.pull_request
&& (contains(github.event.comment.body, '[citest_all]')
|| contains(github.event.comment.body, '[citest_test_converting_readme]'))
&& (contains(fromJson('["OWNER", "MEMBER", "COLLABORATOR"]'),
github.event.comment.author_association)
|| github.event.comment.user.login == 'systemroller')
) || (
github.event_name == 'pull_request'
&& github.event.action == 'opened'
&& (contains(github.event.pull_request.labels.*.name, 'citest_all')
|| contains(github.event.pull_request.labels.*.name, 'citest_test_converting_readme'))
&& (contains(fromJson('["OWNER", "MEMBER", "COLLABORATOR"]'),
github.event.pull_request.author_association)
|| github.event.pull_request.user.login == 'systemroller')
) || (
github.event_name == 'pull_request'
&& github.event.action == 'synchronize'
&& (contains(github.event.pull_request.labels.*.name, 'citest_all')
|| contains(github.event.pull_request.labels.*.name, 'citest_test_converting_readme'))
&& (contains(fromJson('["OWNER", "MEMBER", "COLLABORATOR"]'),
github.event.pull_request.author_association)
|| github.event.sender.login == 'systemroller')
) || (
github.event_name == 'pull_request'
&& github.event.action == 'labeled'
&& (github.event.label.name == 'citest_all'
|| github.event.label.name == 'citest_test_converting_readme')
&& (contains(fromJson('["OWNER", "MEMBER", "COLLABORATOR"]'),
github.event.pull_request.author_association)
|| github.event.sender.login == 'systemroller')
)
runs-on: ubuntu-latest
permissions:
pull-requests: read
contents: write
steps:
- name: Update pip, git
run: |
set -euxo pipefail
sudo apt update
sudo apt install -y git
- name: Get PR head SHA
if: github.event_name == 'issue_comment'
id: head_sha
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
PR_NUMBER: ${{ github.event.issue.number }}
run: |
set -euxo pipefail
head_sha=$(gh api "repos/$REPO/pulls/$PR_NUMBER" --jq '.head.sha')
echo "head_sha=$head_sha" >> "$GITHUB_OUTPUT"
- name: Check out code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
persist-credentials: false
ref: ${{ steps.head_sha.outputs.head_sha || github.sha }}
- name: Remove badges from README.md prior to converting to HTML
run: sed -i '1,8 {/^\[\!.*actions\/workflows/d}' README.md
- name: Convert README.md to HTML
uses: docker://pandoc/core:latest
with:
args: >-
--from gfm --to html5 --toc --shift-heading-level-by=-1
--template .pandoc_template.html5
--output README.html README.md
- name: Upload README.html as an artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: README.html
path: README.html