Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 2 additions & 16 deletions .github/workflows/auto-approve.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,7 @@
name: Auto-approve PR

on: pull_request_target

permissions:
contents: write
pull-requests: write

jobs:
auto-approve-renovate-prs:
runs-on: ubuntu-latest
steps:
- name: Git Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: '0'
- name: Approve PR
if: github.actor == 'renovate[bot]'
run: gh pr review --approve ${{ github.event.number }}
env:
GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
auto-approve:
uses: palashmon/reusable-workflows/.github/workflows/auto-approve.yml@main
90 changes: 5 additions & 85 deletions .github/workflows/gh-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: GitHub Release
on:
workflow_run:
workflows: [CI]
branches: [master]
branches: [main]
types: [completed]

concurrency:
Expand All @@ -16,88 +16,8 @@ permissions:
pull-requests: write

jobs:
build:
call-workflow:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: "20.x"
- run: npm i
- run: npm test

changelog:
name: Changelog
needs:
- build
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest

outputs:
skipped: ${{ steps.changelog.outputs.skipped }}
tag: ${{ steps.changelog.outputs.tag }}
clean_changelog: ${{ steps.changelog.outputs.clean_changelog }}
version: ${{ steps.changelog.outputs.version }}

env:
PR_BRANCH: release/ci-${{ github.sha }}

steps:
- name: Checkout branch
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: '0'

- name: Create release branch
run: |
git checkout -b ${{ env.PR_BRANCH }}

- name: Create Changelog
id: changelog
uses: TriPSs/conventional-changelog-action@dd19d7c07e5f620b2d6f48d547148a4b6b29e92f # v3.19.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
git-user-name: "github-actions"
git-user-email: "github-actions[bot]@users.noreply.github.com"
git-branch: ${{ env.PR_BRANCH }}
skip-git-pull: true
output-file: false
create-summary: true
skip-on-empty: false
release-count: 10

# create PR using GitHub CLI
- name: Create Changelog PR
if: steps.changelog.outputs.skipped == 'false'
run: |
gh pr create --base master --head ${{ env.PR_BRANCH }} --title 'chore(release): ${{ steps.changelog.outputs.tag }} [skip-ci]' --body '${{ steps.changelog.outputs.clean_changelog }}'
env:
GH_TOKEN: ${{ github.token }}

- name: Merge Changelog PR
if: steps.changelog.outputs.skipped == 'false'
run: |
gh pr merge --squash --auto --delete-branch ${{ env.PR_BRANCH }}
env:
GH_TOKEN: ${{ github.token }}

release:
name: GitHub Release
needs: changelog
if: github.event_name != 'pull_request' && needs.changelog.outputs.skipped == 'false'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- name: Create Release
uses: softprops/action-gh-release@9d7c94cfd0a1f3ed45544c887983e9fa900f0564 # v2.0.4
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: ${{ needs.changelog.outputs.tag }}
tag_name: ${{ needs.changelog.outputs.tag }}
draft: false
generate_release_notes: true
make_latest: 'true'
prerelease: false
uses: palashmon/reusable-workflows/.github/workflows/gh-release.yml@main
with:
branch_name: 'master'
22 changes: 2 additions & 20 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,8 @@
name: CI
on:
- push
- pull_request

on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: Node.js ${{ matrix.node-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version:
- 20
- 18
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm test
uses: palashmon/reusable-workflows/.github/workflows/main-build.yml@main