chore/workflow-update/draft/4 #14
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
# ╭──────────────────────────────────────────────────────────────────╮ | |
# │ 🐙 GITHUB ACIONS CI/CD WORKFLOW │ | |
# ┣──────────────────────────────────────────────────────────────────┫ | |
# │ Responsible for: │ | |
# │ ➤ [1] check for correct build(s) │ | |
# │ ➤ [2] build check of project as a Check PR Label │ | |
# ╰──────────────────────────────────────────────────────────────────╯ | |
name: 'Pull-Request [to-main]' | |
on: | |
pull_request: | |
branches: | |
- main | |
types: | |
- opened | |
- reopened | |
- labeled | |
- unlabeled | |
- synchronize | |
jobs: | |
# ╭──────────────────────────────────────────────────────────────────╮ | |
# │ NOTE: │ | |
# │ ➤ [1] check for correct build(s) │ | |
# ╰──────────────────────────────────────────────────────────────────╯ | |
npm-build-check: | |
name: 🧪 JOB /:/ NPM check build | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18.19.0 | |
- name: 'STEP /:/ set npm version' | |
run: | | |
npm install -g npm@10.2.3 | |
- name: 'STEP /:/ create .env' | |
run: | | |
cp ./env/.env.docker.file .env | |
- name: 'STEP /:/ build npm' | |
env: | |
NODE_OPTIONS: "--max-old-space-size=8192" | |
run: | | |
npm ci | |
npm run build | |
# | |
# ╭──────────────────────────────────────────────────────────────────╮ | |
# │ NOTE: │ | |
# │ ➤ [2] check for correct PR Label │ | |
# ╰──────────────────────────────────────────────────────────────────╯ | |
pull-request-check-labels: | |
name: 🏷️ JOB /:/ PR check labels | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: mheap/github-action-required-labels@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
mode: maximum | |
count: 1 | |
labels: | | |
semver:patch | |
semver:minor | |
semver:major | |
# | |
# ╭──────────────────────────────────────────────────────────────────────────────────╮ | |
# │ 💠 │ JOB | PULL-REQUEST FORMAT │ | |
# ╰──────────────────────────────────────────────────────────────────────────────────╯ | |
pull-request-format: | |
name: 🎛️ JOB /:/ PR format | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: 'STEP /:/ checkout source code' | |
uses: actions/checkout@v4 | |
with: | |
token: '${{ secrets.GH_TOKEN }}' | |
fetch-depth: 0 | |
fetch-tags: true | |
ref: ${{ github.head_ref }} | |
- name: 'STEP /:/ generate PR body' | |
id: testing | |
run: | | |
git fetch origin main:main | |
echo "$(git branch | cat)" | |
echo "$(git branch --show-current)" | |
git log main.. --format=%B | cat > ./temp-pr-body.md | |
echo "$(cat ./temp-pr-body.md)" | |
# ╭───── | |
# │ NOTE: | |
# │ |: Not recommended for use | |
# │ |: 🔗 read-more |:| https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ | |
# ╰───── | |
- uses: tzkhan/pr-update-action@v2 | |
with: | |
repo-token: "${{ secrets.GH_TOKEN }}" | |
base-branch-regex: '.*' | |
head-branch-regex: '.*' | |
title-template: '%headbranch%' | |
title-update-action: 'replace' | |
title-uppercase-head-match: false | |
body-template: null | |
# $(git log main.. --format=%B | cat) | |
body-update-action: 'replace' | |
body-uppercase-base-match: false | |
# |