-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use gh in composite action (#938)
* feat: use gh in composite action * add shell * syntax * token name * input name * don't build just test * remove needs build * remove typescript code * update approve step * use artifact to test pr branch * fix workflow * sha to branch name * update readme * update readme * remove unnecessary files * test matrix os * multi-os lowercase * missing output name * update readme * bump major
- Loading branch information
1 parent
c2125c1
commit a660677
Showing
20 changed files
with
55 additions
and
24,458 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,22 +1,10 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
day: "thursday" | ||
labels: | ||
- "dependencies" | ||
|
||
- package-ecosystem: "npm" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
day: "thursday" | ||
open-pull-requests-limit: 1 | ||
ignore: | ||
- dependency-name: "*" | ||
update-types: ["version-update:semver-major"] | ||
labels: | ||
- "dependencies" | ||
|
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 |
---|---|---|
|
@@ -20,18 +20,6 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.x | ||
- run: npm ci | ||
- run: npm run build | ||
- run: npm run format-check | ||
- run: npm run lint | ||
- run: npm run test | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: dist | ||
path: dist | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: action.yml | ||
|
@@ -40,21 +28,15 @@ jobs: | |
testWithRequiredStatusChecks: | ||
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository | ||
needs: [build] | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
target: [built, committed] | ||
os: [windows-latest, ubuntu-latest, macos-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ci-test/status-check-base-${{ matrix.target }} | ||
- if: matrix.target == 'built' || github.event_name == 'pull_request' | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: dist | ||
path: dist | ||
- if: matrix.target == 'built' || github.event_name == 'pull_request' | ||
uses: actions/download-artifact@v3 | ||
ref: ci-test/status-check-base-${{ matrix.os }} | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: action.yml | ||
path: . | ||
|
@@ -67,17 +49,17 @@ jobs: | |
uses: peter-evans/create-pull-request@v4 | ||
with: | ||
token: ${{ secrets.ACTIONS_BOT_TOKEN }} | ||
commit-message: '[CI] test ${{ matrix.target }}' | ||
commit-message: '[CI] test ${{ matrix.os }}' | ||
committer: GitHub <[email protected]> | ||
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> | ||
title: '[CI] test ${{ matrix.target }}' | ||
title: '[CI] test ${{ matrix.os }}' | ||
body: | | ||
- CI test case for target '${{ matrix.target }}' | ||
- CI test case for target '${{ matrix.os }}' | ||
Auto-generated by [create-pull-request][1] | ||
[1]: https://github.com/peter-evans/create-pull-request | ||
branch: ci-test/status-check-branch-${{ matrix.target }} | ||
branch: ci-test/status-check-branch-${{ matrix.os }}-${{ github.sha }} | ||
|
||
- name: Enable Pull Request Automerge | ||
uses: ./ | ||
|
@@ -89,21 +71,15 @@ jobs: | |
testWithRequiredReviews: | ||
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository | ||
needs: [build] | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
target: [built, committed] | ||
os: [windows-latest, ubuntu-latest, macos-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ci-test/reviews-base-${{ matrix.target }} | ||
- if: matrix.target == 'built' || github.event_name == 'pull_request' | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: dist | ||
path: dist | ||
- if: matrix.target == 'built' || github.event_name == 'pull_request' | ||
uses: actions/download-artifact@v3 | ||
ref: ci-test/reviews-base-${{ matrix.os }} | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: action.yml | ||
path: . | ||
|
@@ -116,17 +92,17 @@ jobs: | |
uses: peter-evans/create-pull-request@v4 | ||
with: | ||
token: ${{ secrets.ACTIONS_BOT_TOKEN }} | ||
commit-message: '[CI] test ${{ matrix.target }}' | ||
commit-message: '[CI] test ${{ matrix.os }}' | ||
committer: GitHub <[email protected]> | ||
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> | ||
title: '[CI] test ${{ matrix.target }}' | ||
title: '[CI] test ${{ matrix.os }}' | ||
body: | | ||
- CI test case for target '${{ matrix.target }}' | ||
- CI test case for target '${{ matrix.os }}' | ||
Auto-generated by [create-pull-request][1] | ||
[1]: https://github.com/peter-evans/create-pull-request | ||
branch: ci-test/reviews-branch-${{ matrix.target }}-${{ github.sha }} | ||
branch: ci-test/reviews-branch-${{ matrix.os }}-${{ github.sha }} | ||
|
||
- name: Enable Pull Request Automerge | ||
uses: ./ | ||
|
@@ -137,31 +113,6 @@ jobs: | |
|
||
- name: Auto approve | ||
if: steps.cpr.outputs.pull-request-operation == 'created' | ||
uses: peter-evans/approve-pull-request-action@v2 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
number: ${{ steps.cpr.outputs.pull-request-number }} | ||
|
||
package: | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | ||
needs: [testWithRequiredStatusChecks, testWithRequiredReviews] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: dist | ||
path: dist | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v4 | ||
with: | ||
token: ${{ secrets.ACTIONS_BOT_TOKEN }} | ||
commit-message: Update distribution | ||
title: Update distribution | ||
body: | | ||
- Updates the distribution for changes on `main` | ||
Auto-generated by [create-pull-request][1] | ||
[1]: https://github.com/peter-evans/create-pull-request | ||
branch: update-distribution | ||
run: gh pr review --approve "${{ steps.cpr.outputs.pull-request-number }}" | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -12,6 +12,7 @@ on: | |
description: The major version tag to update | ||
options: | ||
- v2 | ||
- v3 | ||
|
||
jobs: | ||
tag: | ||
|
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,4 +1 @@ | ||
lib/ | ||
node_modules/ | ||
|
||
.DS_Store |
This file was deleted.
Oops, something went wrong.
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
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
Oops, something went wrong.