Skip to content

Commit

Permalink
Merge branch 'redhat-openshift-ecosystem:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Jooho authored Aug 24, 2023
2 parents efc465b + eb72a1e commit a271331
Show file tree
Hide file tree
Showing 15,333 changed files with 3,752,524 additions and 33,538 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
30 changes: 11 additions & 19 deletions .github/workflows/command_merge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ on: issue_comment
name: Issue Comments - merge
env:
OPP_PRODUCTION_TYPE: "ocp"
OPP_THIS_REPO_NAME: "community-operators-prod"
OPP_THIS_REPO_ORG: "redhat-openshift-ecosystem"

jobs:
handle_comments:
Expand All @@ -12,29 +14,19 @@ jobs:
runs-on: ubuntu-latest
steps:

- uses: actions/github-script@v4
- uses: actions/github-script@v6
id: labels
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const labels = await github.issues.listLabelsOnIssue({
const labels = await github.rest.issues.listLabelsOnIssue({
issue_number: context.payload.issue.number,
owner: context.repo.owner,
repo: context.repo.repo
})
console.log(labels.data)
return labels.data
# - name: Print info about event
# id: info
# continue-on-error: true
# uses: actions/github-script@v3
# with:
# github-token: ${{secrets.GITHUB_TOKEN}}
# script: |
# console.log(context)
# console.log(`::set-output name=xxx::${context.payload.issue.labels}`)

- name: Merge command handler
id: command
uses: xt0rted/slash-command-action@v1
Expand All @@ -47,7 +39,7 @@ jobs:
permission-level: write

- name: Merge message when not able to merge and inform user about authorized_changes
uses: actions/github-script@v3
uses: actions/github-script@v6
if: |
steps.command.outputs.command-name == 'merge' &&
steps.command.outputs.command-arguments == 'possible' &&
Expand All @@ -60,39 +52,39 @@ jobs:
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.issues.createComment({
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Current PR can be merged automatically, but there is missing `authorized-changes` label. One can find out more info [here](https://operator-framework.github.io/community-operators/operator-ci-yaml/#reviewers).'
body: 'Current PR can be merged automatically, but there is missing `authorized-changes` label. One can find out more info [here](https://${OPP_THIS_REPO_ORG}.github.io/${OPP_THIS_REPO_NAME}/operator-ci-yaml/#reviewers).'
})
- name: Message when automerge is disabled
uses: actions/github-script@v3
uses: actions/github-script@v6
if: |
steps.command.outputs.command-name == 'merge' &&
steps.command.outputs.command-arguments == 'possible' &&
(contains(fromJSON(steps.labels.outputs.result).*.name, 'automerge-disabled'))
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.issues.createComment({
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Automatic merge is disabled temporarily due to a maintenance.'
})
- name: Message when dco-failed is missing
uses: actions/github-script@v3
uses: actions/github-script@v6
if: |
steps.command.outputs.command-name == 'merge' &&
steps.command.outputs.command-arguments == 'possible' &&
(contains(fromJSON(steps.labels.outputs.result).*.name, 'dco-failed'))
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.issues.createComment({
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/command_retest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,32 @@ jobs:
permission-level: read

- name: Doing hold
uses: actions/github-script@v3
uses: actions/github-script@v6
if: |
steps.command.outputs.command-name == 'retest'
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.issues.createComment({
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '/hold'
})
- name: Sleep for 10 seconds
uses: jakejarvis/wait-action@master
with:
time: '10s'

- name: Doing hold cancel
uses: actions/github-script@v3
uses: actions/github-script@v6
if: |
steps.command.outputs.command-name == 'retest'
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.issues.createComment({
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/dco_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ env:
OPP_THIS_BRANCH: "main"
OPP_PROD: 0
OPP_DRY_RUN: 0
KIND_KUBE_VERSION: "v1.22.7"
KIND_KUBE_VERSION: "v1.27.1"
OPP_PRODUCTION_TYPE: "ocp"
OPP_REVIEWERS_ENABLED: 1

Expand All @@ -32,12 +32,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
- id: files
uses: jitterbit/get-changed-files@v1
uses: masesgroup/retrieve-changed-files@v2
continue-on-error: true
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
Expand Down
31 changes: 17 additions & 14 deletions .github/workflows/dco_workflow_complete.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 'Download artifact'
uses: actions/github-script@v3.1.0
uses: actions/github-script@v6
with:
script: |
var artifacts = await github.actions.listWorkflowRunArtifacts({
var artifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{github.event.workflow_run.id }},
});
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
return artifact.name == "pr"
})[0];
var download = await github.actions.downloadArtifact({
var download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
Expand All @@ -38,16 +38,17 @@ jobs:
- name: 'PR Number'
id: pr-number
run: |
PR=$(cat ./NR)
echo "::set-output name=pr::${PR}"
PR=$(tr -dc [0-9] <./NR)
[ -z "$PR" ] && echo "Invalid PR number" && exit 1
echo "pr=${PR}" >> $GITHUB_OUTPUT
- uses: actions/github-script@v4
- uses: actions/github-script@v6
id: pr-labels
continue-on-error: true
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const labels = await github.issues.listLabelsOnIssue({
const labels = await github.rest.issues.listLabelsOnIssue({
issue_number: ${{ steps.pr-number.outputs.pr }},
owner: context.repo.owner,
repo: context.repo.repo
Expand All @@ -63,27 +64,29 @@ jobs:
steps:
- name: "Removing dco-failed label"
if: needs.pr.outputs.pr != '0'
uses: actions/github-script@v3
uses: actions/github-script@v6
continue-on-error: true
env:
PR: "${{ needs.pr.outputs.pr }}"
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.issues.removeLabel({
issue_number: ${{ needs.pr.outputs.pr }},
github.rest.issues.removeLabel({
issue_number: process.env.PR,
owner: context.repo.owner,
repo: context.repo.repo,
name: 'dco-failed'
})
# - uses: actions/github-script@v3
# - uses: actions/github-script@v6
# if: |
# (!contains(fromJson(steps.pr-labels.outputs.result).*.name, 'do-not-merge/work-in-progress')) &&
# (!contains(fromJson(steps.pr-labels.outputs.result).*.name, 'do-not-merge/hold'))
# continue-on-error: true
# with:
# github-token: ${{ secrets.FRAMEWORK_MERGE }}
# script: |
# github.issues.createComment({
# github.rest.issues.createComment({
# issue_number: ${{ needs.pr.outputs.pr }},
# owner: context.repo.owner,
# repo: context.repo.repo,
Expand All @@ -97,12 +100,12 @@ jobs:
steps:

- name: "Setting dco-failed label"
uses: actions/github-script@v3
uses: actions/github-script@v6
continue-on-error: true
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.issues.addLabels({
github.rest.issues.addLabels({
issue_number: ${{ needs.pr.outputs.pr }},
owner: context.repo.owner,
repo: context.repo.repo,
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/documentation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
number-of-prs:
description: 'Number of PRs'
required: true
default: '5000'
default: '100'

env:
OPP_THIS_REPO: "redhat-openshift-ecosystem/community-operators-prod"
Expand All @@ -18,20 +18,22 @@ jobs:
runs-on: ubuntu-latest
container: quay.io/operator_testing/community-operators-mkdocs
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
repository: redhat-openshift-ecosystem/community-operators-pipeline
ref: documentation

- name: Generate docs
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPR: ${{ github.event.inputs.number-of-prs || 5000 }}
NPR: ${{ github.event.inputs.number-of-prs || 100 }}
run: |
OPP_THIS_REPO_SED="https://github.com/$OPP_THIS_REPO"
OPP_THIS_REPO_SED=${OPP_THIS_REPO_SED//\//\\/}
sed -i 's/repo_url.*/repo_url: '$OPP_THIS_REPO_SED'/g' mkdocs.yml
sed -i 's/ cluster_type:.*/ cluster_type: ocp/g' mkdocs.yml
cat mkdocs.yml
ci/operator-flow/doc.sh ${NPR} ${OPP_THIS_REPO}
Expand Down
Loading

0 comments on commit a271331

Please sign in to comment.