fix(workflows): rollback deploy changes and make contribs run only on master

pull/1956/head
FonduemangVI 8 months ago
parent 94cd6032da
commit 0e40de2782

@ -1,10 +1,10 @@
name: Build and Deploy Docs
on:
workflow_run:
workflows: [Update contributors]
types:
- completed
push:
branches:
- master
pull_request:
jobs:
build:
@ -44,7 +44,7 @@ jobs:
run: mkdocs build
deploy:
if: github.event.workflow_run.event == 'push' && contains(fromJson('["master", "main"]'), github.event.workflow_run.head_branch)
if: github.event_name == 'push' && contains(fromJson('["refs/heads/master", "refs/heads/main"]'), github.ref)
needs: build
name: Deploy docs
runs-on: ubuntu-latest

@ -4,21 +4,17 @@ on:
push:
branches:
- master
pull_request:
permissions:
contents: write
jobs:
update_contributors:
if: github.event_name == 'push' && contains(fromJson('["refs/heads/master", "refs/heads/main"]'), github.ref)
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} # Use the forked repository if available, otherwise the main repository
ref: ${{ github.event.pull_request.head.ref || github.ref_name }} # Use the PR branch name if available, otherwise the branch name
fetch-depth: 0 # Fetch all history for all branches and tags
- name: Install Node.js
uses: actions/setup-node@v4
@ -34,9 +30,8 @@ jobs:
- name: Commit and push if it's not up to date
run: |
git diff
git config --global user.email "actions@github.com"
git config --global user.name "GitHub Actions"
git checkout -B ${{ github.event.pull_request.head.ref || github.ref_name }} # Ensure we're on the correct branch
git diff
git commit -am "chore(contributors): Update CONTRIBUTORS.md" || exit 0
git push origin ${{ github.event.pull_request.head.ref || github.ref_name }}
git push

Loading…
Cancel
Save