-
Notifications
You must be signed in to change notification settings - Fork 3.9k
[ci] use GitHub built-in token, switch comment-triggered jobs to workflow dispatch (fixes #7012) #7035
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
Open
jameslamb
wants to merge
30
commits into
master
Choose a base branch
from
fix/comment-triggered-jobs
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+146
−255
Open
[ci] use GitHub built-in token, switch comment-triggered jobs to workflow dispatch (fixes #7012) #7035
Changes from 27 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
1216212
[ci] use GItHub built-in token (fixes #7012)
jameslamb de45d8f
avoid other CI runs
jameslamb a11d408
run on push
jameslamb 9a2b5e2
try more permissions
jameslamb 3c9a20e
does the token interfere with actions/checkout?
jameslamb e3a3192
hmmm
jameslamb a3bd0ce
ah, use API URL
jameslamb d9e0503
try a reusable workflow instead of repository_dispatch
jameslamb 43a3ced
try just running valgrind directly
jameslamb 7007ff8
more permissions stuff
jameslamb 36983b6
change image
jameslamb 42e07a6
arg not argjson
jameslamb 258db78
update script
jameslamb 46f383b
stricter permissions
jameslamb e32a7b0
more permissions fiddling
jameslamb 23e6a74
more permissions tightening
jameslamb 09eed1e
actually, fully run valgrind
jameslamb 617cb11
test r_configure
jameslamb ad6eded
update r_configure
jameslamb 6c681d6
more changes
jameslamb db2dce3
Auto-update configure
github-actions[bot] c97b4b2
move get-workflow-status to a shell script
jameslamb 0413fb9
submodules not necessary for configure
jameslamb 16c52fc
Merge branch 'fix/comment-triggered-jobs' of github.com:microsoft/Lig…
jameslamb 5439e43
change step name
jameslamb d411062
more updates
jameslamb b4dde79
restore CI
jameslamb d10de26
docs, rename
jameslamb 8a6dd73
merge master
jameslamb 5a9d95c
Merge branch 'master' into fix/comment-triggered-jobs
jameslamb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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,32 @@ | ||
#!/bin/bash | ||
|
||
# | ||
# ./.ci/get-workflow-status.sh 'fix/comment-triggered-jobs' 'r_valgrind.yml' | ||
# | ||
|
||
set -e -u -o pipefail | ||
|
||
BRANCH="${1}" | ||
WORKFLOW_FILE="${2}" | ||
|
||
echo "Searching for latest run of '${WORKFLOW_FILE}' on branch '${BRANCH}'" | ||
|
||
LATEST_RUN_ID=$( | ||
gh run list \ | ||
--repo "microsoft/LightGBM" \ | ||
--branch "${BRANCH}" \ | ||
--workflow "${WORKFLOW_FILE}" \ | ||
--json 'createdAt,databaseId' \ | ||
--jq 'sort_by(.createdAt) | reverse | .[0] | .databaseId' | ||
) | ||
|
||
if [[ "${LATEST_RUN_ID}" == "" ]]; then | ||
echo "No runs of '${WORKFLOW_FILE}' found on branch '${BRANCH}'" | ||
exit 0 | ||
fi | ||
|
||
echo "Checking status of workflow run '${LATEST_RUN_ID}'" | ||
gh run view \ | ||
--repo "microsoft/LightGBM" \ | ||
--exit-status \ | ||
"${LATEST_RUN_ID}" |
This file contains hidden or 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 hidden or 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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,8 +1,27 @@ | ||
name: R generate configure | ||
|
||
on: | ||
repository_dispatch: | ||
types: [gha_run_r_configure] | ||
workflow_dispatch: | ||
inputs: | ||
pr-branch: | ||
type: string | ||
description: | | ||
Branch in microsoft/LightGBM to update. | ||
|
||
permissions: | ||
actions: none | ||
checks: none | ||
contents: write | ||
deployments: none | ||
discussions: none | ||
id-token: write | ||
issues: none | ||
packages: none | ||
pages: none | ||
pull-requests: read | ||
repository-projects: none | ||
security-events: none | ||
statuses: none | ||
|
||
jobs: | ||
r-configure: | ||
|
@@ -24,18 +43,19 @@ jobs: | |
uses: actions/checkout@v5 | ||
with: | ||
fetch-depth: 5 | ||
submodules: true | ||
submodules: false | ||
repository: microsoft/LightGBM | ||
ref: "refs/heads/${{ fromJSON(github.event.client_payload.pr_branch) }}" | ||
token: ${{ secrets.WORKFLOW }} | ||
ref: "refs/heads/${{ inputs.pr-branch }}" | ||
token: ${{ github.token }} | ||
persist-credentials: true | ||
- name: Update configure | ||
shell: bash | ||
run: ./R-package/recreate-configure.sh || exit 1 | ||
- name: Push changes | ||
run: | | ||
git config --global user.name "GitHub Actions Bot" | ||
git config --global user.email "[email protected]" | ||
# source for this user and email: https://github.com/orgs/community/discussions/160496 | ||
git config --global user.name "github-actions[bot]" | ||
git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||
git add "./R-package/configure" | ||
git commit --allow-empty -m "Auto-update configure" | ||
git push |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This ensures a non-0 exit code if the last run was not successful.