Skip to content

Add html-parser-builder, vapor-dsl #2697

Add html-parser-builder, vapor-dsl

Add html-parser-builder, vapor-dsl #2697

Workflow file for this run

name: Automatic Pull Request
on:
issues:
types: [opened, reopened]
env:
SWIFT_IMAGE: swiftlang/swift@sha256:30154112a700a5a95fd1760716bd2040e8b735f54f081a4865823abdec67d17e # swiftlang/swift:nightly-6.0-jammy as of May 26
jobs:
add:
runs-on: ubuntu-20.04
if: contains(github.event.issue.labels.*.name, 'Add Package')
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Add Package to JSON
run: bash .github/add_package.sh
env:
GH_BODY: ${{ github.event.issue.body }}
- name: Validate JSON
run: docker run --rm --env CI=true -v "$PWD:/host" -w /host $SWIFT_IMAGE swift validate.swift
id: validate
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check for Changes
run: bash .github/check_for_changes.sh
id: check
- name: Create Pull Request
id: cpr
if: steps.check.outputs.changes == 'true'
uses: peter-evans/create-pull-request@v3
with:
add-paths: |
packages.json
commit-message: ${{ github.event.issue.title }}
title: ${{ github.event.issue.title }}
branch: spi-auto-${{ github.event.issue.number }}
delete-branch: true
body: |
Closes #${{ github.event.issue.number }}
## Original Message
${{ github.event.issue.body }}
committer: GitHub <noreply@github.com>
author: GitHub <noreply@github.com>
- name: Update Issue (Success)
if: steps.check.outputs.changes == 'true'
uses: actions/github-script@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Thank you! We will approve and add these packages with #${{ steps.cpr.outputs.pull-request-number }}.'
})
- name: Update Issue (Failure)
if: ${{ failure() || steps.check.outputs.changes != 'true' }}
uses: actions/github-script@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'It looks like there’s nothing to do here!\n\nThe package may [already be in the package list](https://github.com/SwiftPackageIndex/PackageList/blob/main/packages.json) or on the [denylist](https://github.com/SwiftPackageIndex/PackageList/blob/main/denylist.json). Or, if you submitted the wrong URL or there’s a typo, please close this issue and [start a new one](https://github.com/SwiftPackageIndex/PackageList/issues/new/choose).\n\n>Validate Error: ${{ steps.validate.outputs.validateError || 'None' }}'
})
remove:
runs-on: ubuntu-20.04
if: contains(github.event.issue.labels.*.name, 'Remove Package')
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Remove Package from JSON
run: bash .github/remove_package.sh
env:
GH_BODY: ${{ github.event.issue.body }}
GH_ISSUE: ${{ github.event.issue.number }}
- name: Validate JSON
run: docker run --rm --env CI=true -v "$PWD:/host" -w /host $SWIFT_IMAGE swift validate.swift
id: validate
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check for Changes
run: bash .github/check_for_changes.sh
id: check
- name: Create Pull Request
id: cpr
if: steps.check.outputs.changes == 'true'
uses: peter-evans/create-pull-request@v3
with:
add-paths: |
packages.json
denylist.json
commit-message: ${{ github.event.issue.title }}
title: ${{ github.event.issue.title }}
branch: spi-auto-${{ github.event.issue.number }}
delete-branch: true
body: |
Closes #${{ github.event.issue.number }}
## Original Message
${{ github.event.issue.body }}
committer: GitHub <noreply@github.com>
author: GitHub <noreply@github.com>
- name: Update Issue (Success)
if: steps.check.outputs.changes == 'true'
uses: actions/github-script@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Thank you! We will approve and remove these packages with #${{ steps.cpr.outputs.pull-request-number }}.'
})
- name: Update Issue (Failure)
if: ${{ failure() || steps.check.outputs.changes != 'true' }}
uses: actions/github-script@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Oh no! We were unable to detect any valid packages in your submission. If you submitted the wrong URL and would like to update it, please [open a new issue](https://github.com/SwiftPackageIndex/PackageList/issues/new/choose).\n\n>Validate Error: ${{ steps.validate.outputs.validateError || 'None' }}'
})