From 82ff1d964617c0d50175c255694873c6d2b14bfe Mon Sep 17 00:00:00 2001 From: Jon Rohan Date: Sat, 10 Apr 2021 13:20:08 -0700 Subject: [PATCH] Rename and use pull_request until it's in main --- .github/workflows/greetings.yml | 126 -------------------------------- 1 file changed, 126 deletions(-) delete mode 100644 .github/workflows/greetings.yml diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml deleted file mode 100644 index 74e84f05..00000000 --- a/.github/workflows/greetings.yml +++ /dev/null @@ -1,126 +0,0 @@ -name: Welcome -on: - pull_request_target: - branches-ignore: - - 'changeset-release/main' - - 'dependabot/**' - -jobs: - greetings: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Set up Node.js - uses: actions/setup-node@v2 - with: - node-version: 14.x - - - name: Get or Create Comment - uses: actions/github-script@v3 - with: - github-token: ${{ secrets.GPR_AUTH_TOKEN_SHARED }} - script: | - const fs = require('fs') - const body = await fs.readFileSync('.github/greetings_template.md', 'utf8') - const result = await github.issues.listComments({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo - }); - const primerComments = result.data.filter(c => c.user.login == 'primer-css') - if (!primerComments.length) { - await github.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: body.replace('{{PR_AUTHOR}}', context.payload.sender.login) - }) - } - - bundle-stats: - needs: greetings - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 - with: - node-version: 14 - - run: yarn - - run: yarn pretest - - name: Reporting bundle sizes - uses: primer/comment-token-update@main - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - comment-token: 'bundle_table' - script: | - echo "### Bundle size changes since latest release" - echo "```" - script/bundle-size-report.js - echo "```" - - - name: Reporting selector diffs - uses: primer/comment-token-update@main - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - comment-token: 'diff_report' - script: | - diff=$(script/selector-diff-report) - if [[ $diff ]]; then - echo "### Selectors added/removed" - echo "```diff" - echo $diff - echo "```" - fi - - label-release: - name: Semantic Version Label - runs-on: ubuntu-latest - steps: - - uses: actions/github-script@v3 - id: version-result - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - result-encoding: string - script: | - const diff_url = context.payload.pull_request.diff_url - const result = await github.request(diff_url) - const match = [...result.data.matchAll(/^\+['"]@primer\/css['"]:\s(patch|minor|major)/m)] - if (match && match[0]) { - return match[0][1] - } - - - uses: actions/github-script@v3 - env: - RELEASE: ${{ steps.version-result.outputs.result }} - with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - if (process.env.RELEASE == 'undefined') { return } - const issue = await github.issues.get({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number - }) - const currentLabels = issue.data.labels.map( l => l.name) - const newLabel = `${process.env.RELEASE} release` - if (!currentLabels.includes(newLabel)) { - const otherReleaseLabels = currentLabels.filter( l => l.endsWith(' release')) - if (otherReleaseLabels.length) { - github.issues.removeLabel({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - name: [otherReleaseLabels] - }) - } - github.issues.addLabels({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - labels: [newLabel] - }) - }