Skip to content
This repository was archived by the owner on Feb 21, 2025. It is now read-only.

Commit 187e76d

Browse files
authored
GITHUB_TOKEN read-only change: Include permission block (#21)
1 parent 02b7127 commit 187e76d

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed

.github/workflows/backport-action.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ on:
4242
jobs:
4343
launch_ado_build:
4444
runs-on: ubuntu-latest
45+
# GITHUB_TOKEN change from read-write to read-only on 2024-02-01 requiring permissions block
46+
# https://docs.opensource.microsoft.com/github/apps/permission-changes/
47+
# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
48+
permissions:
49+
actions: read
50+
contents: read
51+
security-events: write
4552
env:
4653
# Protect against script injection attacks via input variables (i.e., the content of the variables could be executed at the time of evaluation/expansion within a script)
4754
# Scripts must consume the environment variable settings instead

.github/workflows/backport-trigger.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Backport trigger file adapated from https://github.com/xamarin/.github/blob/main/workflow-templates/backport-trigger/backport-trigger.yml
1+
# Backport trigger file adapted from https://github.com/xamarin/.github/blob/main/workflow-templates/backport-trigger/backport-trigger.yml
22
# This trigger file is used as the basis for testing backports within the backport-bot-action repo itself
33
name: Backport Trigger
44

@@ -9,6 +9,13 @@ on:
99
jobs:
1010
setupBackport:
1111
runs-on: ubuntu-latest
12+
# GITHUB_TOKEN change from read-write to read-only on 2024-02-01 requiring permissions block
13+
# https://docs.opensource.microsoft.com/github/apps/permission-changes/
14+
# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
15+
permissions:
16+
actions: write
17+
contents: read
18+
security-events: write
1219
if: github.event.issue.pull_request != '' && startswith(github.event.comment.body, '@gitbot backport')
1320
outputs:
1421
target_branch: ${{ steps.parse_comment.outputs.target_branch }}

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ git tag -f v1.0-test
2323
git push --tags --force
2424
```
2525

26-
To excercise your changes associated with the `v1.0-test` tag, use the following test PR
26+
To exercise your changes associated with the `v1.0-test` tag, use the following test PR
2727
https://github.com/xamarin/backport-bot-action/pull/11
2828

2929
Apply the following comment to the PR
@@ -53,7 +53,7 @@ Please note that for updating the `v1.1` tag (or any other tag you want to push
5353

5454
In order to pick up the changes for Staging, make sure that the backport trigger YAML in your target repo (usually found at https://github.com/xamarin/$REPO_NAME/blob/main/.github/workflows/backport-trigger.yml) points to your desired tag.
5555

56-
For example, https://github.com/xamarin/.github/blob/main/.github/workflows/backport-trigger.yml#L13, the uses line should be updated as follows:
56+
For example, https://github.com/xamarin/.github/blob/main/.github/workflows/backport-trigger.yml#L13, the `uses` line should be updated as follows:
5757
```yaml
5858
- uses: xamarin/backport-bot-action@$TAG_NAME
5959
```
@@ -64,3 +64,9 @@ You can list tags by executing the following command
6464
```
6565
git tag
6666
```
67+
68+
To view the contents of a tag execute the following command:
69+
70+
```
71+
git show $TAG_NAME
72+
```

0 commit comments

Comments
 (0)