Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ad32d8d

Browse files
committed
Upgrade Add to project job workflow
1 parent fbe62b7 commit ad32d8d

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

.github/workflows/add-to-project-board.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
##### Aggregate Commerce PRs and Issues into a respective Organizational Project #####
2+
# Security Note: Uses pull_request_target to allow fork PRs to be added to projects
3+
# This is safe because we only add PRs to projects, no code execution from PRs
24

35
name: Add pull requests and issues to projects
46

@@ -10,6 +12,12 @@ on:
1012
types:
1113
- opened
1214

15+
# Security: Limit permissions to only what's needed
16+
permissions:
17+
pull-requests: write
18+
issues: write
19+
contents: read
20+
1321
jobs:
1422
call-workflow-add-to-project:
1523
uses: ./.github/workflows/add-to-project_job.yml

.github/workflows/add-to-project_job.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,19 @@ on:
55

66
jobs:
77
add-to-project:
8-
if: github.event.repository.fork == false
98
runs-on: ubuntu-latest
109

1110
steps:
1211
- name: Add to Commerce PR project
1312
if: github.event_name == 'pull_request_target'
14-
uses: actions/add-to-project@v0.4.0
13+
uses: actions/add-to-project@v1.0.2
1514
with:
1615
project-url: https://github.com/orgs/AdobeDocs/projects/5 # The organizational project for pull requests
1716
github-token: ${{ secrets.COMMERCE_PROJECT_AUTOMATION }}
1817

1918
- name: Add to Commerce Issue project
2019
if: github.event_name == 'issues'
21-
uses: actions/add-to-project@v0.4.0
20+
uses: actions/add-to-project@v1.0.2
2221
with:
2322
project-url: https://github.com/orgs/AdobeDocs/projects/6 # The organizational project for issues
2423
github-token: ${{ secrets.COMMERCE_PROJECT_AUTOMATION }}

0 commit comments

Comments
 (0)