1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-14 08:17:13 +03:00

github/submodule-update: Let's try github contexts

This commit is contained in:
Athanasius 2022-12-17 11:14:18 +00:00
parent a68c23e525
commit 424e9754b1
No known key found for this signature in database
GPG Key ID: 772697E181BB2767

View File

@ -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 }}']
# });