-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
build: update actions file #39871
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: update actions file #39871
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,28 @@ | ||
name: "authors update" | ||
on: | ||
workflow_dispatch: | ||
name: authors update | ||
on: workflow_dispatch | ||
|
||
jobs: | ||
authors_update: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: '0' # this is required to actually get all the authors | ||
- run: "tools/update-authors.js" # run the AUTHORS tool | ||
fetch-depth: 0 # this is required to actually get all the authors | ||
- run: tools/update-authors.js # run the AUTHORS tool | ||
- uses: gr2m/create-or-update-pull-request-action@v1 # create a PR or update the Action's existing PR | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
title: "meta: update AUTHORS" | ||
body: "If this PR exists, there's presumably new additions to the AUTHORS file. This is an automatically generated PR by the `authors.yml` GitHub Action, which runs `tools/update-authors.js` and submits a new PR or updates an existing PR.\n\nPlease note that there might be duplicate entries. If there are, please remove them and add the duplicate emails to .mailmap directly to this PR." | ||
branch: "actions/authors-update" # custom branch *just* for this Action. | ||
commit-message: "meta: update AUTHORS" | ||
title: 'meta: update AUTHORS' | ||
commit-message: 'meta: update AUTHORS' | ||
author: github-actions[bot] <github-actions[bot]@users.noreply.github.com> | ||
body: > | ||
If this PR exists, there's presumably new additions to the AUTHORS file. | ||
This is an automatically generated PR by the `authors.yml` GitHub Action, | ||
which runs `tools/update-authors.js` and submits a new PR or updates an existing PR. | ||
|
||
|
||
Please note that there might be duplicate entries. If there are, please remove them and | ||
add the duplicate emails to .mailmap directly to this PR. | ||
branch: actions/authors-update # custom branch *just* for this Action. | ||
labels: meta |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
--- | ||
name: Auto Start CI | ||
|
||
on: | ||
|
@@ -7,23 +6,23 @@ on: | |
# optimistic, it can take longer to run. | ||
# To understand why `schedule` is used instead of other events, refer to | ||
# ./doc/guides/commit-queue.md | ||
- cron: "*/5 * * * *" | ||
- cron: '*/5 * * * *' | ||
|
||
env: | ||
NODE_VERSION: lts/* | ||
|
||
jobs: | ||
startCI: | ||
start-ci: | ||
if: github.repository == 'nodejs/node' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
# Install dependencies | ||
- name: Install Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
|
||
- name: Install node-core-utils | ||
run: npm install -g node-core-utils | ||
|
||
|
@@ -32,26 +31,6 @@ jobs: | |
echo "REPOSITORY=$(echo ${{ github.repository }} | cut -d/ -f2)" >> $GITHUB_ENV | ||
echo "OWNER=${{ github.repository_owner }}" >> $GITHUB_ENV | ||
|
||
# Get Pull Requests | ||
- name: Get Pull Requests | ||
uses: octokit/[email protected] | ||
id: get_prs_for_ci | ||
with: | ||
query: | | ||
query prs($owner:String!, $repo:String!) { | ||
repository(owner:$owner, name:$repo) { | ||
pullRequests(labels: ["request-ci"], states: OPEN, last: 100) { | ||
nodes { | ||
number | ||
} | ||
} | ||
} | ||
} | ||
owner: ${{ env.OWNER }} | ||
repo: ${{ env.REPOSITORY }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Setup node-core-utils | ||
run: | | ||
ncu-config set username ${{ secrets.JENKINS_USER }} | ||
|
@@ -60,5 +39,9 @@ jobs: | |
ncu-config set owner ${{ env.OWNER }} | ||
ncu-config set repo ${{ env.REPOSITORY }} | ||
|
||
- name: Start CI | ||
run: ./tools/actions/start-ci.sh ${{ secrets.GITHUB_TOKEN }} ${{ env.OWNER }} ${{ env.REPOSITORY }} $(echo '${{ steps.get_prs_for_ci.outputs.data }}' | jq '.repository.pullRequests.nodes | map(.number) | .[]') | ||
- name: Get Pull Requests and start CI | ||
run: | | ||
prs=`gh pr list --repo ${{ github.repository }} --limit 100 --json number -q 'map(.number) | .[]'` | ||
./tools/actions/start-ci.sh ${{ secrets.GITHUB_TOKEN }} ${{ env.OWNER }} ${{ env.REPOSITORY }} $prs | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,20 +4,15 @@ on: | |
pull_request: | ||
types: [opened, synchronize, reopened, ready_for_review] | ||
push: | ||
branches: | ||
- master | ||
- main | ||
- v[0-9]+.x-staging | ||
- v[0-9]+.x | ||
branches: [master, main, 'v[0-9]+.x-staging', 'v[0-9]+.x'] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I find multiline arrays easier to read (and also to review when elements are added/removed) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The line just above is (and was) a single line areay, and the two lines have almost the same size. Personally I find that when the inline version is short it's easier to read, otherwise I leave it multiline, like in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, I didn't put my comment on the best line. I don't feel strongly about the |
||
|
||
env: | ||
FLAKY_TESTS: dontcare | ||
PYTHON_VERSION: 3.9 | ||
|
||
jobs: | ||
build-tarball: | ||
if: github.event.pull_request.draft == false | ||
env: | ||
PYTHON_VERSION: 3.9 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
@@ -36,13 +31,11 @@ jobs: | |
mkdir tarballs | ||
mv *.tar.gz tarballs | ||
- name: Upload tarball artifact | ||
uses: actions/upload-artifact@v1 | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: tarballs | ||
path: tarballs | ||
test-tarball-linux: | ||
env: | ||
PYTHON_VERSION: 3.9 | ||
needs: build-tarball | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
@@ -54,9 +47,10 @@ jobs: | |
- name: Environment Information | ||
run: npx envinfo | ||
- name: Download tarball | ||
uses: actions/download-artifact@v1 | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: tarballs | ||
path: tarballs | ||
- name: Extract tarball | ||
run: | | ||
tar xzf tarballs/*.tar.gz -C $RUNNER_TEMP | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,35 @@ | ||
name: Comment on issues and PRs when labelled | ||
name: Comment on issues and PRs when labeled | ||
targos marked this conversation as resolved.
Show resolved
Hide resolved
|
||
on: | ||
issues: | ||
types: [labeled] | ||
pull_request_target: | ||
types: [labeled] | ||
|
||
env: | ||
STALE_MESSAGE: >- | ||
This issue/PR was marked as stalled, it will be automatically closed in 30 days. | ||
If it should remain open, please leave a comment explaining why it should remain open. | ||
FAST_TRACK_MESSAGE: Fast-track has been requested by @${{ github.actor }}. Please 👍 to approve. | ||
|
||
jobs: | ||
staleComment: | ||
stale-comment: | ||
if: github.repository == 'nodejs/node' && github.event.label.name == 'stalled' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Post stalled comment | ||
env: | ||
COMMENTS_URL: ${{ github.event.issue.comments_url || github.event.pull_request.comments_url }} | ||
COMMENTS_URL: ${{ github.event.issue.comments_url || github.event.pull_request.comments_url }} | ||
run: | | ||
curl -X POST $COMMENTS_URL \ | ||
-H "Content-Type: application/json" \ | ||
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | ||
--data '{ "body": "This issue/PR was marked as stalled, it will be automatically closed in 30 days. If it should remain open, please leave a comment explaining why it should remain open." }' | ||
--data "{ \"body\": \"$STALE_MESSAGE\" }" | ||
|
||
fastTrack: | ||
if: github.repository == 'nodejs/node' && github.event_name == 'pull_request_target' && github.event.label.name == 'fast-track' | ||
fast-track: | ||
if: github.repository == 'nodejs/node' && github.event.issue.pull_request && github.event.label.name == 'fast-track' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Request Fast-Track | ||
run: gh pr comment ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --body "$FAST_TRACK_MESSAGE" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: gh pr comment ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --body "Fast-track has been requested by @${{ github.actor }}. Please 👍 to approve." |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
--- | ||
# This action requires the following secrets to be set on the repository: | ||
# GH_USER_NAME: GitHub user whose Jenkins and GitHub token are defined below | ||
# GH_USER_TOKEN: GitHub user token, to be used by ncu and to push changes | ||
|
@@ -12,7 +11,7 @@ on: | |
# be read-only, and the Action won't have access to any other repository | ||
# secrets, which it needs to access Jenkins API. | ||
schedule: | ||
- cron: "*/5 * * * *" | ||
- cron: '*/5 * * * *' | ||
|
||
env: | ||
NODE_VERSION: lts/* | ||
|
@@ -33,11 +32,11 @@ jobs: | |
# for push as well. | ||
token: ${{ secrets.GH_USER_TOKEN }} | ||
|
||
# Install dependencies | ||
- name: Install Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
|
||
- name: Install node-core-utils | ||
run: npm install -g node-core-utils@latest | ||
|
||
|
@@ -47,27 +46,6 @@ jobs: | |
echo "OWNER=${{ github.repository_owner }}" >> $GITHUB_ENV | ||
echo "DEFAULT_BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV | ||
|
||
- name: Get Pull Requests | ||
uses: octokit/[email protected] | ||
id: get_mergable_pull_requests | ||
with: | ||
query: | | ||
query release($owner:String!,$repo:String!, $base_ref:String!) { | ||
repository(owner:$owner, name:$repo) { | ||
pullRequests(baseRefName: $base_ref, labels: ["commit-queue"], states: OPEN, last: 100) { | ||
nodes { | ||
number | ||
} | ||
} | ||
} | ||
} | ||
owner: ${{ env.OWNER }} | ||
repo: ${{ env.REPOSITORY }} | ||
# Commit queue is only enabled for the default branch on the repository | ||
base_ref: ${{ env.DEFAULT_BRANCH }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Configure node-core-utils | ||
run: | | ||
ncu-config set branch ${DEFAULT_BRANCH} | ||
|
@@ -78,5 +56,10 @@ jobs: | |
ncu-config set repo "${REPOSITORY}" | ||
ncu-config set owner "${OWNER}" | ||
|
||
- name: Start the commit queue | ||
run: ./tools/actions/commit-queue.sh ${OWNER} ${REPOSITORY} ${{ secrets.GITHUB_TOKEN }} $(echo '${{ steps.get_mergable_pull_requests.outputs.data }}' | jq '.repository.pullRequests.nodes | map(.number) | .[]') | ||
# Commit queue is only enabled for the default branch on the repository. | ||
- name: Get Pull Requests and start the commit queue | ||
run: | | ||
prs=`gh pr list --repo ${{ github.repository }} --base ${{ env.DEFAULT_BRANCH }} --limit 100 --json number -q 'map(.number) | .[]'` | ||
./tools/actions/commit-queue.sh ${OWNER} ${REPOSITORY} ${{ secrets.GITHUB_TOKEN }} $prs | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
Uh oh!
There was an error while loading. Please reload this page.