Bumps the actions group with 6 updates: | Package | From | To | | --- | --- | --- | | [actions/checkout](https://github.com/actions/checkout) | `3` | `4` | | [actions/cache](https://github.com/actions/cache) | `3` | `4` | | [peter-evans/repository-dispatch](https://github.com/peter-evans/repository-dispatch) | `2` | `3` | | [actions/download-artifact](https://github.com/actions/download-artifact) | `3` | `4` | | [Apple-Actions/import-codesign-certs](https://github.com/apple-actions/import-codesign-certs) | `2` | `3` | | [softprops/action-gh-release](https://github.com/softprops/action-gh-release) | `0.1.15` | `2.0.5` | Updates `actions/checkout` from 3 to 4 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) Updates `actions/cache` from 3 to 4 - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v3...v4) Updates `peter-evans/repository-dispatch` from 2 to 3 - [Release notes](https://github.com/peter-evans/repository-dispatch/releases) - [Commits](https://github.com/peter-evans/repository-dispatch/compare/v2...v3) Updates `actions/download-artifact` from 3 to 4 - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v3...v4) Updates `Apple-Actions/import-codesign-certs` from 2 to 3 - [Release notes](https://github.com/apple-actions/import-codesign-certs/releases) - [Commits](https://github.com/apple-actions/import-codesign-certs/compare/v2...v3) Updates `softprops/action-gh-release` from 0.1.15 to 2.0.5 - [Release notes](https://github.com/softprops/action-gh-release/releases) - [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md) - [Commits](https://github.com/softprops/action-gh-release/compare/v0.1.15...v2.0.5) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: peter-evans/repository-dispatch dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: actions/download-artifact dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: Apple-Actions/import-codesign-certs dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: softprops/action-gh-release dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
67 lines
2.3 KiB
YAML
67 lines
2.3 KiB
YAML
name: Preview label
|
|
|
|
on:
|
|
pull_request_target:
|
|
types:
|
|
- labeled
|
|
|
|
env:
|
|
TEAM_CORE_DEVELOPER: core-developers
|
|
|
|
jobs:
|
|
check_preview_label:
|
|
name: Check for preview label
|
|
if: github.event.action == 'labeled' && github.event.label.name == 'preview'
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
- name: Check if label was added by core developer
|
|
id: core_developer
|
|
continue-on-error: true
|
|
uses: octokit/request-action@v2.x
|
|
with:
|
|
route: GET /orgs/OpenTTD/teams/${{ env.TEAM_CORE_DEVELOPER }}/memberships/${{ github.event.sender.login }}
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.PREVIEW_GITHUB_TOKEN }}
|
|
|
|
- if: steps.core_developer.outcome == 'failure'
|
|
name: Remove preview label if not core developer
|
|
uses: octokit/request-action@v2.x
|
|
with:
|
|
route: DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/preview
|
|
owner: ${{ github.event.repository.owner.login }}
|
|
repo: ${{ github.event.repository.name }}
|
|
issue_number: ${{ github.event.number }}
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.PREVIEW_GITHUB_TOKEN }}
|
|
|
|
- if: steps.core_developer.outcome == 'success'
|
|
name: Create deployment
|
|
id: deployment
|
|
uses: octokit/request-action@v2.x
|
|
with:
|
|
route: POST /repos/{owner}/{repo}/deployments
|
|
mediaType: |
|
|
previews:
|
|
- ant-man
|
|
- flash
|
|
owner: ${{ github.event.repository.owner.login }}
|
|
repo: ${{ github.event.repository.name }}
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
task: deploy:preview
|
|
auto_merge: false
|
|
required_contexts: "[]"
|
|
environment: preview-pr-${{ github.event.number }}
|
|
description: "Preview for Pull Request #${{ github.event.number }}"
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.PREVIEW_GITHUB_TOKEN }}
|
|
|
|
- if: steps.core_developer.outcome == 'success'
|
|
name: Trigger 'preview build'
|
|
uses: peter-evans/repository-dispatch@v3
|
|
with:
|
|
token: ${{ secrets.PREVIEW_GITHUB_TOKEN }}
|
|
event-type: "Preview build #${{ github.event.number }}"
|
|
client-payload: '{"folder": "pr${{ github.event.number }}", "sha": "${{ github.event.pull_request.head.sha }}", "deployment_id": "${{ fromJson(steps.deployment.outputs.data).id }}"}'
|