-
-
Notifications
You must be signed in to change notification settings - Fork 235
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(workflows): rollback deploy changes and make contribs run only on…
… master
- Loading branch information
1 parent
94cd603
commit 0e40de2
Showing
2 changed files
with
8 additions
and
13 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 "[email protected]" | ||
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 |