From 3a1372f607093651d93eb7c8d66af3c8811b7662 Mon Sep 17 00:00:00 2001 From: Aditya Pachauri <103623274+AdityyaX@users.noreply.github.com> Date: Tue, 23 Jan 2024 16:04:53 +0530 Subject: [PATCH 1/4] demo changes --- .DS_Store | Bin 0 -> 6148 bytes label.yml | 28 ++++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 .DS_Store create mode 100644 label.yml diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..4e388bbe18bab11e3692c757944f7ad1da9a1d27 GIT binary patch literal 6148 zcmeHK!Ab)$5S_HuZmB{K3OxqAR;*nS#LH6a54fTSmAXrdF5PZQcWV!&uxI@tzr^ox zCP~Fod+{JrW?=FrlbH>937HK5i1ws+3{V3A2bHi;!R7~{ancnjSP!Al-#COJ1dyOU ztwgiqKQcgjw*wjOSPBF9zJGlfhtqTv#wx^^_iz+PY1V9hh(fWnwOw|~PSttvpVidQ zf^3qugYg~pu9b?zg&l-9QGeR4?OmuO3!wwffpROk9;z^OQu zZmm9>xvtxgZp)oF*`v*toSKUE8Ow_9(Rp9y4vTJbxZ)mJt--|y^ zVwKQYUF0wF7?}ZPfEn0i2JD^ZR5y8%yf$Wl8Tb_gbU#Q`LeFAuP+uL`(C;ISmk3GF zrndy4wCGvP4dMujFsXQAsE+H~5u;hAzbz fOQpDuss;U$3`EajZV){v{3D=g;D#CaQwBZ(0#8n! literal 0 HcmV?d00001 diff --git a/label.yml b/label.yml new file mode 100644 index 0000000..0f3303d --- /dev/null +++ b/label.yml @@ -0,0 +1,28 @@ +name: Labeler + +on: + pull_request: + types: + - opened + +jobs: + label: + runs-on: ubuntu-latest + + steps: + - name: Check out code + uses: actions/checkout@v2 + + - name: Apply labels from associated issues + run: | + ISSUE_NUMBER=$(curl -s ${{ github.event.pull_request.issue_url }} | jq -r '.number') + LABELS=$(curl -s ${{ github.event.repository.issues_url }}/{$ISSUE_NUMBER}/labels | jq -r 'map(.name) | join(",")') + + if [ -n "$LABELS" ]; then + echo "Applying labels to pull request: $LABELS" + gh pr edit ${{ github.event.number }} --add-labels "$LABELS" + else + echo "No labels found on associated issue." + fi + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 2471a853324b18e97abf96e826a1e202b558abb8 Mon Sep 17 00:00:00 2001 From: Aditya Pachauri <103623274+AdityyaX@users.noreply.github.com> Date: Tue, 23 Jan 2024 16:34:33 +0530 Subject: [PATCH 2/4] done --- .vscode/settings.json | 5 +++++ label.yml | 21 +++++++++------------ 2 files changed, 14 insertions(+), 12 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..dd66a5e --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "github-actions.workflows.pinned.workflows": [ + ".github/workflows/label.yml" + ] +} \ No newline at end of file diff --git a/label.yml b/label.yml index 0f3303d..8c013f4 100644 --- a/label.yml +++ b/label.yml @@ -9,20 +9,17 @@ jobs: label: runs-on: ubuntu-latest - steps: + steps: - name: Check out code uses: actions/checkout@v2 - - name: Apply labels from associated issues + - name: Extract issue number run: | - ISSUE_NUMBER=$(curl -s ${{ github.event.pull_request.issue_url }} | jq -r '.number') - LABELS=$(curl -s ${{ github.event.repository.issues_url }}/{$ISSUE_NUMBER}/labels | jq -r 'map(.name) | join(",")') + ISSUE_NUMBER=$(curl -s https://api.github.com/repos/AdityyaX/Task_Manager_CRUD/issues/2 | jq -r '.number') + echo "Issue Number: $ISSUE_NUMBER" - if [ -n "$LABELS" ]; then - echo "Applying labels to pull request: $LABELS" - gh pr edit ${{ github.event.number }} --add-labels "$LABELS" - else - echo "No labels found on associated issue." - fi - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Fetch labels from the issue + run: | + LABELS=$(curl -s "${{ github.event.repository.issues_url }}/${ISSUE_NUMBER}/labels" | jq -r 'map(.name) | join(",")') + echo "Labels: $LABELS" From 78fbf224b3cc806cdffa0c15f8ea144a0fda10b7 Mon Sep 17 00:00:00 2001 From: Aditya Pachauri <103623274+AdityyaX@users.noreply.github.com> Date: Tue, 23 Jan 2024 16:36:22 +0530 Subject: [PATCH 3/4] done --- label.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/label.yml b/label.yml index 8c013f4..bd51179 100644 --- a/label.yml +++ b/label.yml @@ -1,6 +1,9 @@ name: Labeler on: + push: + branches: + - main # Adjust the branch name as needed pull_request: types: - opened @@ -9,7 +12,7 @@ jobs: label: runs-on: ubuntu-latest - steps: + steps: - name: Check out code uses: actions/checkout@v2 @@ -18,8 +21,6 @@ jobs: ISSUE_NUMBER=$(curl -s https://api.github.com/repos/AdityyaX/Task_Manager_CRUD/issues/2 | jq -r '.number') echo "Issue Number: $ISSUE_NUMBER" - - name: Fetch labels from the issue run: | - LABELS=$(curl -s "${{ github.event.repository.issues_url }}/${ISSUE_NUMBER}/labels" | jq -r 'map(.name) | join(",")') - echo "Labels: $LABELS" + LABELS=$(curl -s "${{ github.event From 7486dc2d98c1e0a658b5395c630f2f114884016e Mon Sep 17 00:00:00 2001 From: Aditya Pachauri <103623274+AdityyaX@users.noreply.github.com> Date: Tue, 23 Jan 2024 16:37:14 +0530 Subject: [PATCH 4/4] done --- label.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/label.yml b/label.yml index bd51179..d4cdb26 100644 --- a/label.yml +++ b/label.yml @@ -3,7 +3,8 @@ name: Labeler on: push: branches: - - main # Adjust the branch name as needed + - main + - dev # Adjust the branch name as needed pull_request: types: - opened