Create CI/CD #7
Workflow file for this run
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: Quality | |
on: | |
pull_request: | |
jobs: | |
gitmoji: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: false | |
- name: Get commits from pull request | |
shell: bash | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
curl -s -H "Authorization: token $GITHUB_TOKEN" \ | |
"https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/commits" \ | |
| jq -r '.[].commit.message' > commit_messages.txt | |
- name: Get all gitmoji's | |
shell: bash | |
run: | | |
curl -s https://gitmoji.dev/api/gitmojis > gitmoji_spec.json | |
cat gitmoji_spec.json | jq '.gitmojis[] | .emoji, .code' > gitmojis.txt | |
- name: Check if commit messages start with a gitmoji | |
shell: bash | |
run: | | |
gitmoji_script="${{ github.workspace }}/.github/scripts/ensure_all_commits_start_with_gitmoji.sh" | |
# Set executable permission on the script | |
chmod +x $gitmoji_script | |
# Check each commit message | |
$gitmoji_script commit_messages.txt gitmojis.txt |