generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub workflow for automatically updating
index.js
- Loading branch information
1 parent
63d15e7
commit 1aec294
Showing
11 changed files
with
95 additions
and
67 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
dist/ | ||
action/ | ||
lib/ | ||
node_modules/ | ||
node_modules/ |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Pull request authors are not expected to update `action/index.js` themselves | ||
name: Check no dist update | ||
on: | ||
pull_request: | ||
# For simplicity determine if the file was changed using `paths` here (instead of running any diff command below) | ||
# There are some limitations to this, but they most likely won't cause any issues here | ||
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#git-diff-comparisons | ||
paths: | ||
- 'action/index.js' | ||
|
||
jobs: | ||
check-no-dist-update: | ||
name: Check no dist update | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check no dist update | ||
# Fail unconditionally; this workflow is only run if the file has changed, see | ||
# condition at the start of this file | ||
run: | | ||
echo "Pull requests should not update 'action/index.js'" | ||
exit 1 |
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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Update `action/index.js` | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
update-dist: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
# Allow the job to push the changed file to the repository | ||
contents: write | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: npm | ||
|
||
- name: Build and test | ||
run: | | ||
npm -v | ||
node -v | ||
npm clean-install | ||
npm run github_ci_all | ||
# To be safe, verify that either there are no changes or only `action/index.js` has changed | ||
- name: Verify no unexpected changes | ||
run: | | ||
# Check for changes to any file other than `action/index.js`, see https://stackoverflow.com/a/29374503 | ||
# Note that this does not detect new untracked files | ||
if ! git diff --exit-code --quiet -- . ':!action/index.js'; then | ||
echo "Unexpected changes:" | ||
git diff -- . ':!action/index.js' | ||
exit 1 | ||
fi | ||
# Commit and push changes; has no effect if the file did not change | ||
# Important: The push event will not trigger any other workflows, see | ||
# https://github.com/stefanzweifel/git-auto-commit-action?tab=readme-ov-file#commits-made-by-this-action-do-not-trigger-new-workflow-runs | ||
- name: Update dist & push changes | ||
uses: stefanzweifel/git-auto-commit-action@v5 | ||
with: | ||
commit_message: 'Update `action/index.js`' | ||
file_pattern: 'action/index.js' |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
dist/ | ||
action/ | ||
lib/ | ||
node_modules/ | ||
node_modules/ |
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
File renamed without changes.
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