From cc0344f92f3afeec66ed9d5ce1503f541d02d9fd Mon Sep 17 00:00:00 2001 From: iancha1992 Date: Thu, 20 Jul 2023 14:52:44 -0700 Subject: [PATCH 1/3] Testing --- .github/workflows/cherry-picker-on-close.yml | 29 +++++++++ .../workflows/cherry-picker-on-comment.yml | 60 +++++++++++++++++++ .github/workflows/labeler.yml | 4 +- .github/workflows/release-helper.yml | 2 +- .github/workflows/test.txt | 0 5 files changed, 93 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/cherry-picker-on-close.yml create mode 100644 .github/workflows/cherry-picker-on-comment.yml create mode 100644 .github/workflows/test.txt diff --git a/.github/workflows/cherry-picker-on-close.yml b/.github/workflows/cherry-picker-on-close.yml new file mode 100644 index 00000000000000..1442078176c8ee --- /dev/null +++ b/.github/workflows/cherry-picker-on-close.yml @@ -0,0 +1,29 @@ +name: cherry-picker-on-close + +on: + pull_request: + # branches: [master] + types: [closed] + # push: + # branches: [ release_test, 'iancha_test[0-9]' ] + +env: + GH_TOKEN: ${{ secrets.CLASSIC_TOKEN_IAN }} + +jobs: + cherry-picker-on-close: + # if: github.event.pusher.name == 'iancha1992' + # if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + steps: + # - name: Harden Runner + # uses: step-security/harden-runner@6b3083af2869dc3314a0257a42f4af696cc79ba3 # v2.3.1 + # with: + # egress-policy: audit + - name: Logging github event + run: echo '${{ toJSON(github.event) }}' | jq + - name: Run cherrypicker on close + uses: iancha1992/continuous-integration/actions/cherry-picker@feature-cherrypick + with: + triggered-on: closed + pr-number: ${{ github.event.number }} diff --git a/.github/workflows/cherry-picker-on-comment.yml b/.github/workflows/cherry-picker-on-comment.yml new file mode 100644 index 00000000000000..c27eb60e7ec3eb --- /dev/null +++ b/.github/workflows/cherry-picker-on-comment.yml @@ -0,0 +1,60 @@ +name: cherry-picker-on-comment + +on: + issues: + types: [milestoned] + # issue_comment: + # types: [created] + +env: + GH_TOKEN: ${{ secrets.CLASSIC_TOKEN_IAN }} + +jobs: + cherry-picker-on-comment: + if: startsWith(github.event.issue.body, 'Forked from') && (github.event.issue.user.login == 'iancha1992') + runs-on: ubuntu-latest + steps: + - name: Harden Runner + uses: step-security/harden-runner@6b3083af2869dc3314a0257a42f4af696cc79ba3 # v2.3.1 + with: + egress-policy: audit + - name: Logging github event + run: echo '${{ toJSON(github.event) }}' | jq + - name: Run cherrypicker on comment + uses: iancha1992/continuous-integration/actions/cherry-picker@feature-cherrypick + with: + triggered-on: commented + pr-number: ${{ github.event.issue.body }} + + # create-pr: + # permissions: + # # id-token: write + # # contents: write + # issues: write + # pull-requests: write + # runs-on: ubuntu-latest + # steps: + # - run: gh pr create --repo chaheein123/bazel --title cocacola --body hihi --head iancha1992:tomtesting --base fake-release-6.3.0 + # # - run: | + # # curl -L -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.CLASSIC_TOKEN_IAN }}" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/chaheein123/bazel/pulls -d '{"title":"Amazing new feature","body":"Please pull these awesome changes in!","head":"iancha1992:tomtesting","base":"fake-release-6.3.0"}' + # # - run: gh api --method POST -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" \ + # # /repos/OWNER/REPO/pulls \ + # # -f title='Amazing new feature' \ + # # -f body='Please pull these awesome changes in!' \ + # # -f head='octocat:new-feature' \ + # # -f base='master' + # env: + # # GITHUB_TOKEN: ${{ secrets.BAZEL_IO_TOKEN }} + # GITHUB_TOKEN: ${{ secrets.CLASSIC_TOKEN_IAN }} + + + + # - uses: actions/checkout@v3 + # - name: Create Pull Request + # uses: peter-evans/create-pull-request@v5 + # with: + # token: ${{ secret.BAZEL_IO_TOKEN }} + # push-to-fork: chaheein123/bazel + # base: + # title: ianchatesting + # body: hihi diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 2a6ab1c0048c94..60accf09d0b9d5 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -18,6 +18,8 @@ jobs: uses: step-security/harden-runner@6b3083af2869dc3314a0257a42f4af696cc79ba3 # v2.3.1 with: egress-policy: audit + - name: Logging github event + run: echo '${{ toJSON(github.event.pull_request.user.login) }}' | jq - uses: actions/labeler@ba790c862c380240c6d5e7427be5ace9a05c754b # v4.0.3 - if: ${{ github.event.pull_request.draft == false }} \ No newline at end of file + if: ${{ github.event.pull_request.draft == false && github.event.pull_request.user.login != 'iancha1992'}} diff --git a/.github/workflows/release-helper.yml b/.github/workflows/release-helper.yml index b4c94e981ee7df..226c4bb0715965 100644 --- a/.github/workflows/release-helper.yml +++ b/.github/workflows/release-helper.yml @@ -18,6 +18,6 @@ jobs: egress-policy: audit - name: Run helper - uses: bazelbuild/continuous-integration/actions/release-helper@70ab2cc80222b90afde06fa0b3b7c067239777b4 # master + uses: iancha1992/continuous-integration/actions/release-helper@release_test # master with: token: ${{ secrets.BAZEL_IO_TOKEN }} diff --git a/.github/workflows/test.txt b/.github/workflows/test.txt new file mode 100644 index 00000000000000..e69de29bb2d1d6 From 94a519ccc63d4e271ce5749745bc71d337657550 Mon Sep 17 00:00:00 2001 From: "Ian (Hee) Cha" Date: Mon, 31 Jul 2023 14:09:42 -0700 Subject: [PATCH 2/3] Please ignore. This is for Automation testing This is for testing --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ee4c8b4eaa434f..5ee367eb380e0c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# [Bazel](https://bazel.build) +# [Bazel](https://bazel.build)a *{Fast, Correct} - Choose two* From 0a10449eb0f2f8e2364d9c566eb64d0929b4dd75 Mon Sep 17 00:00:00 2001 From: iancha1992 Date: Fri, 25 Aug 2023 15:13:24 -0700 Subject: [PATCH 3/3] Tsting --- hiworld.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 hiworld.txt diff --git a/hiworld.txt b/hiworld.txt new file mode 100644 index 00000000000000..e69de29bb2d1d6