Compare commits
4 Commits
v1.2.1-cf.
...
main
Author | SHA1 | Date |
---|---|---|
|
fce75e1aed | |
|
085421f910 | |
|
309f2468be | |
|
aa8cbd1093 |
|
@ -0,0 +1,34 @@
|
||||||
|
name: Backport
|
||||||
|
|
||||||
|
on:
|
||||||
|
# NOTE(negz): This is a risky target, but we run this action only when and if
|
||||||
|
# a PR is closed, then filter down to specifically merged PRs. We also don't
|
||||||
|
# invoke any scripts, etc from within the repo. I believe the fact that we'll
|
||||||
|
# be able to review PRs before this runs makes this fairly safe.
|
||||||
|
# https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
|
||||||
|
pull_request_target:
|
||||||
|
types: [closed]
|
||||||
|
# See also commands.yml for the /backport triggered variant of this workflow.
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
# NOTE(negz): I tested many backport GitHub actions before landing on this
|
||||||
|
# one. Many do not support merge commits, or do not support pull requests with
|
||||||
|
# more than one commit. This one does. It also handily links backport PRs with
|
||||||
|
# new PRs, and provides commentary and instructions when it can't backport.
|
||||||
|
# The main gotchas with this action are that it _only_ supports merge commits,
|
||||||
|
# and that PRs _must_ be labelled before they're merged to trigger a backport.
|
||||||
|
open-pr:
|
||||||
|
runs-on: ubuntu-18.04
|
||||||
|
if: github.event.pull_request.merged
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Open Backport PR
|
||||||
|
uses: zeebe-io/backport-action@v0.0.4
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
github_workspace: ${{ github.workspace }}
|
||||||
|
version: v0.0.4
|
|
@ -0,0 +1,92 @@
|
||||||
|
name: Comment Commands
|
||||||
|
|
||||||
|
on: issue_comment
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
points:
|
||||||
|
runs-on: ubuntu-18.04
|
||||||
|
if: startsWith(github.event.comment.body, '/points')
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Extract Command
|
||||||
|
id: command
|
||||||
|
uses: xt0rted/slash-command-action@v1
|
||||||
|
with:
|
||||||
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
command: points
|
||||||
|
reaction: "true"
|
||||||
|
reaction-type: "eyes"
|
||||||
|
allow-edits: "false"
|
||||||
|
permission-level: write
|
||||||
|
- name: Handle Command
|
||||||
|
uses: actions/github-script@v4
|
||||||
|
env:
|
||||||
|
POINTS: ${{ steps.command.outputs.command-arguments }}
|
||||||
|
with:
|
||||||
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
script: |
|
||||||
|
const points = process.env.POINTS
|
||||||
|
|
||||||
|
if (isNaN(parseInt(points))) {
|
||||||
|
console.log("Malformed command - expected '/points <int>'")
|
||||||
|
github.reactions.createForIssueComment({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
comment_id: context.payload.comment.id,
|
||||||
|
content: "confused"
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const label = "points/" + points
|
||||||
|
|
||||||
|
// Delete our needs-points-label label.
|
||||||
|
try {
|
||||||
|
await github.issues.deleteLabel({
|
||||||
|
issue_number: context.issue.number,
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
name: ['needs-points-label']
|
||||||
|
})
|
||||||
|
console.log("Deleted 'needs-points-label' label.")
|
||||||
|
}
|
||||||
|
catch(e) {
|
||||||
|
console.log("Label 'needs-points-label' probably didn't exist.")
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add our points label.
|
||||||
|
github.issues.addLabels({
|
||||||
|
issue_number: context.issue.number,
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
labels: [label]
|
||||||
|
})
|
||||||
|
console.log("Added '" + label + "' label.")
|
||||||
|
|
||||||
|
# NOTE(negz): See also backport.yml, which is the variant that triggers on PR
|
||||||
|
# merge rather than on comment.
|
||||||
|
backport:
|
||||||
|
runs-on: ubuntu-18.04
|
||||||
|
if: github.event.issue.pull_request && startsWith(github.event.comment.body, '/backport')
|
||||||
|
steps:
|
||||||
|
- name: Extract Command
|
||||||
|
id: command
|
||||||
|
uses: xt0rted/slash-command-action@v1
|
||||||
|
with:
|
||||||
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
command: backport
|
||||||
|
reaction: "true"
|
||||||
|
reaction-type: "eyes"
|
||||||
|
allow-edits: "false"
|
||||||
|
permission-level: write
|
||||||
|
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Open Backport PR
|
||||||
|
uses: zeebe-io/backport-action@v0.0.4
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
github_workspace: ${{ github.workspace }}
|
||||||
|
version: v0.0.4
|
|
@ -0,0 +1,21 @@
|
||||||
|
name: Labels
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch: {}
|
||||||
|
schedule:
|
||||||
|
- cron: '0 0 * * *'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
create-labels:
|
||||||
|
runs-on: ubuntu-18.04
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Create Default Labels
|
||||||
|
uses: crazy-max/ghaction-github-labeler@v3
|
||||||
|
with:
|
||||||
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
yaml-file: .github/default-labels.yml
|
||||||
|
skip-delete: true
|
|
@ -4,10 +4,10 @@ on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
version:
|
version:
|
||||||
description: "Release version (e.g. v0.1.0)"
|
description: 'Release version (e.g. v0.1.0)'
|
||||||
required: true
|
required: true
|
||||||
message:
|
message:
|
||||||
description: "Tag message"
|
description: 'Tag message'
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
@ -23,4 +23,4 @@ jobs:
|
||||||
with:
|
with:
|
||||||
version: ${{ github.event.inputs.version }}
|
version: ${{ github.event.inputs.version }}
|
||||||
message: ${{ github.event.inputs.message }}
|
message: ${{ github.event.inputs.message }}
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
@ -368,10 +368,6 @@ func SubtestForManagedResourceCRD(crd *kextv1.CustomResourceDefinition) func(t *
|
||||||
{Raw: []byte(`"Delete"`)},
|
{Raw: []byte(`"Delete"`)},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// TODO(negz): Ensure that 'name' defaults to 'default'
|
|
||||||
// once we expect providers to be built against
|
|
||||||
// crossplane-runtime v0.14+, which will includ3
|
|
||||||
// https://github.com/crossplane/crossplane-runtime/pull/255
|
|
||||||
"providerConfigRef": {
|
"providerConfigRef": {
|
||||||
Type: "object",
|
Type: "object",
|
||||||
Required: []string{"name"},
|
Required: []string{"name"},
|
||||||
|
@ -419,6 +415,14 @@ func SubtestForManagedResourceCRD(crd *kextv1.CustomResourceDefinition) func(t *
|
||||||
// often are.
|
// often are.
|
||||||
internal.IgnoreFieldsOfMapKey("spec", "Required"),
|
internal.IgnoreFieldsOfMapKey("spec", "Required"),
|
||||||
|
|
||||||
|
// TODO(negz): Verify that provider config and deletion
|
||||||
|
// policy defaulting is in place once providers have had
|
||||||
|
// enough time to update to runtime v0.14 (which is not
|
||||||
|
// yet released at the time of writing).
|
||||||
|
// https://github.com/crossplane/crossplane-runtime/pull/255
|
||||||
|
internal.IgnoreFieldsOfMapKey("providerConfigRef", "Default"),
|
||||||
|
internal.IgnoreFieldsOfMapKey("deletionPolicy", "Default"),
|
||||||
|
|
||||||
// We're only concerned with the spec and status fields that we expect
|
// We're only concerned with the spec and status fields that we expect
|
||||||
// all managed resources to include.
|
// all managed resources to include.
|
||||||
internal.OnlySubproperties("spec", "deletionPolicy", "providerConfigRef", "writeConnectionSecretToRef"),
|
internal.OnlySubproperties("spec", "deletionPolicy", "providerConfigRef", "writeConnectionSecretToRef"),
|
||||||
|
|
Loading…
Reference in New Issue