19 Commits

Author SHA1 Message Date
Tom Stellard
0be1c3b92b
[workflows] Mention the correct user who makes a /cherry-pick comment (#82680)
We were mentioning the creator of the issue with the comment rather than
the creator of the comment.

Fixes #82580
2024-03-09 14:20:15 -08:00
Tom Stellard
bd65547805
[workflows] Create a more descriptive title and body when creating a PR for backports (#80396)
When a backport request is made, the resulting pull request will have a
title like this:

<release branch>: <First line of HEAD commit for the branch>

And a body that says:

Backport <commit0> <commit1> ..

Requested By: <user>
2024-02-09 13:04:49 -08:00
Tom Stellard
d2c8167345
[workflows] Use a custom token for creating backport PRs (#79501)
The CI tests don't get triggered if a PR is created by the builtin
github token, so we need to use a custom token when creating a PR.
2024-01-26 11:25:53 -08:00
Tom Stellard
e99edf6bcb
[workflows] Drop the intermediate /branch comment for release workflow (#79481)
We used to support a /branch comment to specify a branch with commits to
backport to the release branch. However, now that we can use pull
requests this is not needed.

This also simplifies the process, because now the cherry-pick job can
create the pull request directly instead of having it split across two
separate jobs.
2024-01-25 13:11:09 -08:00
Nikita Popov
f03a60d4d2
Use correct tokens in release issue workflow (#79300)
We should use the normal github.token for interacting with issues/PRs on
the repo, and separately pass the `--branch-repo-token` for creating the
branch in the llvmbot repo.
2024-01-24 16:05:56 +01:00
Nikita Popov
5db2e5801d
Add necessary permissions to release issue workflow (#79272)
The `/cherry-pick` command needs `issues: write` to post a comment on
the issue. The `/branch` command also posts a comment, and also needs
`pull-requests: write` to open a PR.

This should fix the failure encountered at
https://github.com/llvm/llvm-project/issues/79253#issuecomment-1907850027.
2024-01-24 15:42:48 +01:00
Nikita Popov
416b079336
Fix release issue workflow (#79268)
Remove the `--phab-token` argument (which currently eats the subsequent
"auto" as the token no longer exists) and related code.

I think this will fix the workflow failure in
https://github.com/llvm/llvm-project/issues/79253#issuecomment-1907679229.
2024-01-24 11:23:28 +01:00
Danila Malyutin
01475dc29a
[github] Make branch workflow more robust (#66781)
Avoid false positives by requiring space after `/branch` command so the
action won't trigger on diffs that include filenames like
`.../BranchProbabilityInfo.cpp`.
2023-09-19 22:18:16 +03:00
Mohammed Keyvanzadeh
859e6aa100
[github] GitHub Actions workflows changes (#65856)
- Remove usages of the non-existent `ignore-forks` field, conditions in
jobs already exist to prevent the jobs from running in forks.
- Don't use variables in the `printf` format string. Use `printf
"..%s.." "$foo"`. ([SC2059](https://www.shellcheck.net/wiki/SC2059))
- Double quote variable expansion to prevent globbing and word
splitting. ([SC2086](https://www.shellcheck.net/wiki/SC2086))
- Prefer `[ p ] || [ q ]` as `[ p -o q ]` is not well defined.
([SC2166](https://www.shellcheck.net/wiki/SC2166))
- Consider `{ cmd1; cmd2; } >> file` instead of individual redirects.
([SC2129](https://www.shellcheck.net/wiki/SC2129))
- Use `$(...)` notation instead of legacy notation `...`.
([SC2006](https://www.shellcheck.net/wiki/SC2006))
- Use `./*glob*` or `-- *glob*` so names with dashes won't become
options. ([SC2035](https://www.shellcheck.net/wiki/SC2035))
- Refactor JavaScript code in certain workflows.
- Change workflow variable substitution style of some workflows to be
consistent with others.
2023-09-13 01:51:47 +03:30
Marc Auberer
6d2aaa5fdb
[GitHub] use checkout action v4 (#65819)
Upgrade checkout action to v4 to make use of node20.
Node 16, which v3 is using, reaches end of life on 2023-09-11.
2023-09-12 12:08:56 +02:00
Joyce Brum
829b8912cd feat: harden permissions for all github workflows
Signed-off-by: Joyce Brum <joycebrum@google.com>

Reviewed By: tstellar

Differential Revision: https://reviews.llvm.org/D144119
2023-03-03 21:34:27 -08:00
Mohammed Keyvanzadeh
d30b187f7d
[github] update actions and make tweaks
- Update the GitHub workflow actions to their latest versions.
- Use the latest Node.js LTS release.
- Use the latest Ubuntu version for consistency across all workflows.
- The `set-output` command is deprecated and will soon be disabled (https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/) so use the new recommended way.
- Use the `$()` expressions for string interpolation instead of the deprecated backticks in Bash.
- Format the YAML files.

Differential Revision: https://reviews.llvm.org/D143015
2023-02-01 06:23:33 +03:30
Tom Stellard
b9a6629193 workflows: Pass phab token to github-automation.py when creating a pull request
The script needs this in order to automatically assign a reviewer.
2022-07-29 09:59:55 -07:00
Tom Stellard
b1dace63b1 workflows: Use correct access token when pushing to llvm-project-release-prs repo
The checkout action will hard-code the default github actions token in
the git config so that all pushes use it.  We need to set
persist-credentials=false so we can use a token that has permission
to push to the llvm-project-release-prs repo.
2022-07-27 20:14:54 -07:00
Tom Stellard
f673dcc693 github: Automatically assign reviewers for backport requests
When there is a backport request, the GitHub Action that handles the
backport will now automatically assign the issue to the user(s) who
approved the commit in Phabricator and create an issue comment asking
them to review the request.

Reviewed By: thieta, kwk

Differential Revision: https://reviews.llvm.org/D126423
2022-07-26 15:30:27 -07:00
Mohammed Keyvanzadeh
7e5f75aa37
[github] format and refactor GitHub workflows
Format and refactor the GitHub workflow for consistency.

Differential Revision: https://reviews.llvm.org/D125197
2022-06-11 11:31:21 +04:30
Tom Stellard
fee491a10a issue-release-workflow: Add support for /cherry-pick command in issue body
Reviewed By: kwk

Differential Revision: https://reviews.llvm.org/D119312
2022-02-16 22:18:06 -08:00
Tom Stellard
9bbe44fb9d github: Fix automated PR creation for backports
GitHub Actions stores the token used for checking out a git repo in
the git configuration and then uses that token for pushes from that
repo too.  We need to use a different token for push because we
are pushing to the llvmbot/llvm-project repo and not the upstream repo,
so we need to disable persist-credentials when checking out the source.
2022-02-04 22:22:01 -08:00
Tom Stellard
daf82a51a0 github: Add actions to automate part of the release workflow
This adds support for automatically cherry-picking and testing fixes for the
release branch using 'commands' in issue comments.  The two supported commands are:

/cherry-pick <commit1> <commit2> ...

Which will backport and test commits from main.  And also

/branch owner/repo/branch

Which will test commits from the given branch.

Reviewed By: alexbatashev, kwk

Differential Revision: https://reviews.llvm.org/D117386
2022-02-03 15:03:59 -08:00