feat(workflow): make common linter re-usable #52
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: Release Notification Test | |
on: | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
- reopened | |
jobs: | |
validate_simplified_changelog: | |
runs-on: ubuntu-latest | |
steps: | |
- name: remove contributors section | |
env: | |
# yamllint disable rule:line-length | |
RELEASE_BODY: | | |
## What's Changed | |
* chore: update global workflows by [@LizardByte-bot](https://github.com/LizardByte-bot) in [#314](https://github.com/LizardByte/plexhints/pull/314) | |
* build(deps): bump LizardByte/setup-release-action from 2024.725.234618 to 2024.801.192524 by [@dependabot](https://github.com/dependabot) in [#315](https://github.com/LizardByte/plexhints/pull/315) | |
* build(deps): bump tqdm from 4.66.4 to 4.66.5 by [@dependabot](https://github.com/dependabot) in [#316](https://github.com/LizardByte/plexhints/pull/316) | |
* docs: arhive repo by [@ReenigneArcher](https://github.com/ReenigneArcher) in [#317](https://github.com/LizardByte/plexhints/pull/317) | |
**Full Changelog**: https://github.com/LizardByte/plexhints/compare/v2024.726.1720...v2024.809.14117 | |
--- | |
## Contributors | |
<a href="https://github.com/dependabot" target="_blank" rel="external noopener noreferrer" aria-label="GitHub profile of contributor, dependabot" ><img src="https://github.com/dependabot.png?size=40" width="40" height="40" alt="dependabot" title="dependabot: 2 merges" ></a><a href="https://github.com/LizardByte-bot" target="_blank" rel="external noopener noreferrer" aria-label="GitHub profile of contributor, LizardByte-bot" ><img src="https://github.com/LizardByte-bot.png?size=40" width="40" height="40" alt="LizardByte-bot" title="LizardByte-bot: 1 merge" ></a><a href="https://github.com/ReenigneArcher" target="_blank" rel="external noopener noreferrer" aria-label="GitHub profile of contributor, ReenigneArcher" ><img src="https://github.com/ReenigneArcher.png?size=40" width="40" height="40" alt="ReenigneArcher" title="ReenigneArcher: 1 merge" ></a> | |
# yamllint enable rule:line-length | |
id: output | |
# this step should be an exact duplicate of the step in the release-notifier.yml | |
run: | | |
echo "${RELEASE_BODY}" > ./release_body.md | |
modified_body=$(sed '/^---/,$d' ./release_body.md) | |
echo "modified_body: ${modified_body}" | |
# use a heredoc to ensure the output is multiline | |
echo "SIMPLIFIED_BODY<<EOF" >> $GITHUB_OUTPUT | |
echo "${modified_body}" >> $GITHUB_OUTPUT | |
echo "EOF" >> $GITHUB_OUTPUT | |
- name: Validate output | |
env: | |
# yamllint disable rule:line-length | |
EXPECTED_OUTPUT: | | |
## What's Changed | |
* chore: update global workflows by [@LizardByte-bot](https://github.com/LizardByte-bot) in [#314](https://github.com/LizardByte/plexhints/pull/314) | |
* build(deps): bump LizardByte/setup-release-action from 2024.725.234618 to 2024.801.192524 by [@dependabot](https://github.com/dependabot) in [#315](https://github.com/LizardByte/plexhints/pull/315) | |
* build(deps): bump tqdm from 4.66.4 to 4.66.5 by [@dependabot](https://github.com/dependabot) in [#316](https://github.com/LizardByte/plexhints/pull/316) | |
* docs: arhive repo by [@ReenigneArcher](https://github.com/ReenigneArcher) in [#317](https://github.com/LizardByte/plexhints/pull/317) | |
**Full Changelog**: https://github.com/LizardByte/plexhints/compare/v2024.726.1720...v2024.809.14117 | |
# yamllint enable rule:line-length | |
run: | | |
# using the env variable output directly fails, so load them using a heredoc | |
EXPECTED_OUTPUT=$(cat <<EOF | |
${EXPECTED_OUTPUT} | |
EOF | |
) | |
SIMPLIFIED_BODY=$(cat <<EOF | |
${{ steps.output.outputs.SIMPLIFIED_BODY }} | |
EOF | |
) | |
echo "EXPECTED_OUTPUT: ${EXPECTED_OUTPUT}" | |
echo "SIMPLIFIED_BODY: ${SIMPLIFIED_BODY}" | |
test "${EXPECTED_OUTPUT}" = "${SIMPLIFIED_BODY}" |