Update tests description #208
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update tests description | |
on: | |
schedule: | |
- cron: 0 23 * * * | |
workflow_dispatch: | |
jobs: | |
update-tests-description: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
# A token is needed to be able to push on main, maybe this can be changed later | |
# with another GHA or with some webhook? | |
# This token is linked to a personal account (already used for GCP runner) | |
# So in case of token issue you have to check (no specific order and for example): | |
# - the expiration date | |
# - if the account associated still exists | |
# - if the person still has access to the repo | |
token: ${{ secrets.SELF_HOSTED_RUNNER_PAT_TOKEN }} | |
- name: Generate tests description file | |
id: readme_generator | |
run: | | |
# Generate checksum of current file | |
FILE="tests/README.md" | |
OLD_CHK=$(sha512sum ${FILE} 2>/dev/null) || true | |
# Create new file | |
pushd tests >/dev/null && make generate-readme && popd >/dev/null | |
# Generate checksum of new file | |
NEW_CHK=$(sha512sum ${FILE} 2>/dev/null) || true | |
# Compare checksum and set generate value if needed | |
if [[ "${NEW_CHK}" != "${OLD_CHK}" ]]; then | |
echo "generate=needed" >> ${GITHUB_OUTPUT} | |
fi | |
- uses: EndBug/add-and-commit@v9 | |
if: steps.readme_generator.outputs.generate == 'needed' | |
with: | |
default_author: github_actions | |
message: 'ci: update tests/README.md file' | |
add: 'tests/README.md' |