From 424e9754b1ac82d2eb4a9c1c70bca07922de5c0c Mon Sep 17 00:00:00 2001 From: Athanasius Date: Sat, 17 Dec 2022 11:14:18 +0000 Subject: [PATCH] github/submodule-update: Let's try `github` contexts --- .github/workflows/submodule-update.yml | 42 +++++++++++++------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/workflows/submodule-update.yml b/.github/workflows/submodule-update.yml index ac1823e4..b47812ca 100644 --- a/.github/workflows/submodule-update.yml +++ b/.github/workflows/submodule-update.yml @@ -56,29 +56,29 @@ jobs: github-token: "${{ secrets.GITHUB_TOKEN }}" script: | await github.rest.pulls.create({ - owner: '${process.env.OWNER}', - repo: '${process.env.PARENT_REPOSITORY}'.split('/')[1].trim(), + owner: '${{ github.repository_owner }}', + repo: '${{ github.repository }}'.split('/')[1].trim(), head: process.env.GITHUB_RUN_ID, - base: '${process.env.PR_AGAINST_BRANCH}', + base: '${{ github.ref }}', title: `[Auto-generated] Submodule Updates ${process.env.GITHUB_RUN_ID}`, body: `[Auto-generated] Submodule Updates ${process.env.GITHUB_RUN_ID}`, }); - - name: Add labels - if: steps.check_for_changes.outputs.changes == 'true' - uses: actions/github-script@v6 - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - script: | - const res = await github.rest.issues.listForRepo({ - owner: '${process.env.OWNER}', - repo: '${process.env.PARENT_REPOSITORY}'.split('/')[1].trim(), - }); - const pr = res.data.filter(i => i.title.includes(process.env.GITHUB_RUN_ID)); - const prNumber = pr[0].number; - await github.rest.issues.addLabels({ - issue_number: prNumber, - owner: '${process.env.OWNER}', - repo: '${process.env.PARENT_REPOSITORY}'.split('/')[1].trim(), - labels: ['${{ inputs.label }}'] - }); +# - name: Add labels +# if: steps.check_for_changes.outputs.changes == 'true' +# uses: actions/github-script@v6 +# with: +# github-token: "${{ secrets.GITHUB_TOKEN }}" +# script: | +# const res = await github.rest.issues.listForRepo({ +# owner: '${{ github.repository_owner }}', +# repo: '${{ github.repository }}'.split('/')[1].trim(), +# }); +# const pr = res.data.filter(i => i.title.includes(process.env.GITHUB_RUN_ID)); +# const prNumber = pr[0].number; +# await github.rest.issues.addLabels({ +# issue_number: prNumber, +# owner: '${{ github.repository_owner }}', +# repo: '${{ github.repository }}'.split('/')[1].trim(), +# labels: ['${{ inputs.label }}'] +# });