This repository was archived by the owner on May 7, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +21
-7
lines changed Expand file tree Collapse file tree 2 files changed +21
-7
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,17 @@ Example
50
50
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
51
51
` ` `
52
52
53
+ You can also optionally specify the PR number of the branch to rebase,
54
+ if the action you're running doesn't directly refer to a specific
55
+ pull request :
56
+
57
+ ` ` ` yaml
58
+ - name: Automatic Rebase
59
+ uses: cirrus-actions/[email protected]
60
+ env:
61
+ GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
62
+ PR_NUMBER: 1245
63
+ ` ` `
53
64
54
65
55
66
# # Restricting who can call the action
Original file line number Diff line number Diff line change 2
2
3
3
set -e
4
4
5
- PR_NUMBER=$( jq -r " .pull_request.number" " $GITHUB_EVENT_PATH " )
6
- if [[ " $PR_NUMBER " == " null" ]]; then
7
- PR_NUMBER=$( jq -r " .issue.number" " $GITHUB_EVENT_PATH " )
8
- fi
9
- if [[ " $PR_NUMBER " == " null" ]]; then
10
- echo " Failed to determine PR Number."
11
- exit 1
5
+ if [ -z " $PR_NUMBER " ]; then
6
+ PR_NUMBER=$( jq -r " .pull_request.number" " $GITHUB_EVENT_PATH " )
7
+ if [[ " $PR_NUMBER " == " null" ]]; then
8
+ PR_NUMBER=$( jq -r " .issue.number" " $GITHUB_EVENT_PATH " )
9
+ fi
10
+ if [[ " $PR_NUMBER " == " null" ]]; then
11
+ echo " Failed to determine PR Number."
12
+ exit 1
13
+ fi
12
14
fi
15
+
13
16
echo " Collecting information about PR #$PR_NUMBER of $GITHUB_REPOSITORY ..."
14
17
15
18
if [[ -z " $GITHUB_TOKEN " ]]; then
You can’t perform that action at this time.
0 commit comments