Skip to content

Commit

Permalink
chore: update actions
Browse files Browse the repository at this point in the history
  • Loading branch information
RakuJa committed May 30, 2024
1 parent b7c21aa commit 96c90dc
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 30 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
on: [pull_request]
on:
pull_request:
types: [opened, synchronize, edited, review_requested, ready_for_review]
name: PR
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
Expand Down
33 changes: 4 additions & 29 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
on: [push]
on:
push:
branches:
- "*"
name: Push
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}

jobs:
clippy_check:
Expand All @@ -20,29 +21,3 @@ jobs:
- uses: mbrobbel/rustfmt-check@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
changelog:
name: Generate changelog
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Generate a changelog
uses: orhun/git-cliff-action@v3
with:
config: cliff.toml
args: --verbose
env:
OUTPUT: CHANGELOG.md
GITHUB_REPO: ${{ github.repository }}

- name: Commit
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
set +e
git add CHANGELOG.md
git commit --no-verify -m "Update changelog"
git push https://${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git ${{ env.BRANCH_NAME }}
36 changes: 36 additions & 0 deletions .github/workflows/push_on_main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Push on main
on:
push:
branches:
- 'master'

env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}

jobs:
changelog:
name: Generate changelog
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Generate a changelog
uses: orhun/git-cliff-action@v3
with:
config: cliff.toml
args: --verbose
env:
OUTPUT: CHANGELOG.md
GITHUB_REPO: ${{ github.repository }}

- name: Commit
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
set +e
git add CHANGELOG.md
git commit --no-verify -m "Update changelog"
git push https://${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git ${{ env.BRANCH_NAME }}

0 comments on commit 96c90dc

Please sign in to comment.