lol sound #774
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: Sanitize | |
on: | |
pull_request: | |
branches: [ master ] | |
workflow_dispatch: | |
jobs: | |
sanitize: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Install sox, jq and pip packages | |
run: | | |
sudo apt-get -qq update | |
sudo apt-get -qq -y install libsox-fmt-mp3 sox jq | |
python3 -m pip install -r requirements.txt | |
- name: Get changed files | |
uses: lots0logs/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
# - name: Run sanitize.py | |
# run: jq -r '.[]' ${HOME}/files.json | xargs python3 sanitize.py -v -- | |
# - name: Commit changes | |
# uses: stefanzweifel/git-auto-commit-action@v4 | |
# with: | |
# commit_message: 'CI: Sanitize mp3' | |
# commit_author: 'GitHub Actions <[email protected]>' | |
# - name: Post comment for sanitize | |
# uses: actions/github-script@v3 | |
# with: | |
# github-token: ${{ secrets.GITHUB_TOKEN }} | |
# script: | | |
# github.issues.createComment({ | |
# issue_number: context.issue.number, | |
# owner: context.repo.owner, | |
# repo: context.repo.repo, | |
# body: 'CI: mp3 files have been sanitized 🔉' | |
# }) | |
- name: Check if student has bought Hall Voice Change on intra | |
id: check-commands | |
env: | |
API42_ID: ${{ secrets.API42_ID }} | |
API42_SECRET: ${{ secrets.API42_SECRET }} | |
continue-on-error: true | |
run: jq -r '.[] | select(startswith("custom")) | split("/")[] | select(endswith(".json")) | split(".json")[0]' ${HOME}/files.json | xargs python3 check-commands.py -v -- | |
- name: Post comment for check-commands (OK) | |
if: steps.check-commands.outcome == 'success' | |
uses: actions/github-script@v3 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
github.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: 'CI: HallVoice check on intra shop: OK ✅' | |
}) | |
- name: Post comment for check-commands (KO) | |
if: steps.check-commands.outcome != 'success' | |
uses: actions/github-script@v3 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
github.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: 'CI: HallVoice check on intra shop: KO ❌' | |
}) | |
core.setFailed('HallVoice check on intra shop KO') | |