mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-09 10:28:44 +02:00
👷 Update action.yml
This commit is contained in:
18
.github/workflows/action.yml
vendored
18
.github/workflows/action.yml
vendored
@@ -1,9 +1,16 @@
|
|||||||
name: Add PRs to Combodo PRs Dashboard
|
name: Add PRs to Combodo PRs Dashboard
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request_target:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
- opened
|
- opened
|
||||||
|
issues:
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
workflow_call:
|
||||||
|
secrets:
|
||||||
|
PR_AUTOMATICALLY_ADD_TO_PROJECT:
|
||||||
|
required: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
add-to-project:
|
add-to-project:
|
||||||
@@ -31,23 +38,22 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
curl -X POST -H "Authorization: token ${{ secrets.PR_AUTOMATICALLY_ADD_TO_PROJECT }}" \
|
curl -X POST -H "Authorization: token ${{ secrets.PR_AUTOMATICALLY_ADD_TO_PROJECT }}" \
|
||||||
-H "Accept: application/vnd.github.v3+json" \
|
-H "Accept: application/vnd.github.v3+json" \
|
||||||
https://api.github.com/repos/Combodo/iTop/issues/${{ github.event.pull_request.number }}/labels \
|
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels \
|
||||||
-d '{"labels":["internal"]}'
|
-d '{"labels":["internal"]}'
|
||||||
|
|
||||||
- name: Set PR author as assignee if member of the organization
|
- name: Set PR author as assignee if member of the organization
|
||||||
if: env.is_member == 'true'
|
if: env.is_member == 'true' && github.event_name == 'pull_request'
|
||||||
run: |
|
run: |
|
||||||
curl -L \
|
curl -L \
|
||||||
-X POST \
|
-X POST \
|
||||||
-H "Accept: application/vnd.github+json" \
|
-H "Accept: application/vnd.github+json" \
|
||||||
-H "Authorization: Bearer ${{ secrets.PR_AUTOMATICALLY_ADD_TO_PROJECT }}" \
|
-H "Authorization: Bearer ${{ secrets.PR_AUTOMATICALLY_ADD_TO_PROJECT }}" \
|
||||||
https://api.github.com/repos/Combodo/iTop/issues/${{ github.event.pull_request.number }}/assignees \
|
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/assignees \
|
||||||
-d '{"assignees":["${{ github.event.pull_request.user.login }}"]}'
|
-d '{"assignees":["${{ github.event.pull_request.user.login }}"]}'
|
||||||
env:
|
env:
|
||||||
is_member: ${{ env.is_member }}
|
is_member: ${{ env.is_member }}
|
||||||
|
|
||||||
- name: Add PR to the appropriate project
|
- name: Add PR to the appropriate project
|
||||||
uses: actions/add-to-project@v1.0.2
|
uses: actions/add-to-project@v2
|
||||||
with:
|
with:
|
||||||
project-url: ${{ env.project_url }}
|
project-url: ${{ env.project_url }}
|
||||||
github-token: ${{ secrets.PR_AUTOMATICALLY_ADD_TO_PROJECT }}
|
github-token: ${{ secrets.PR_AUTOMATICALLY_ADD_TO_PROJECT }}
|
||||||
|
|||||||
Reference in New Issue
Block a user