[github actions] add minimal workflow to test token (#140363)
Add a workflow that simply: 1. checkout repo 2. write a file 3. create a PR This is used to verify the permissions and validity of the github token we use to create PR. context: https://chat.google.com/room/AAAAc_4rqiI/Ck593Sg7mvs If we think the triggering condition is complicated, I can also change this workflow to be manual dispatch, to make it truly minimal.
This commit is contained in:
2
.github/workflows/easy-cp.yml
vendored
2
.github/workflows/easy-cp.yml
vendored
@@ -60,7 +60,7 @@ jobs:
|
||||
base: ${{ env.RELEASE_BRANCH }}
|
||||
branch: cp-${{ env.CHANNEL }}-${{ env.COMMIT_SHA }}
|
||||
path: flutter
|
||||
token: ${{ secrets.FLUTTERMIRRORINGBOT_TOKEN}}
|
||||
token: ${{ secrets.FLUTTERACTIONSBOT_CP_TOKEN }}
|
||||
labels: |
|
||||
cp: review
|
||||
title: '[${{ env.CHANNEL }}-cherrypick] cherrypicks commit ${{ env.COMMIT_SHA }} from PR ${{ github.event.pull_request.title }}'
|
||||
|
||||
44
.github/workflows/minimal.yml
vendored
Normal file
44
.github/workflows/minimal.yml
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
# Copyright 2023 The Flutter Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
name: Minimal workflow to test github action token
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: master
|
||||
types: [labeled]
|
||||
|
||||
permissions: write-all
|
||||
|
||||
jobs:
|
||||
minimal_token_test:
|
||||
name: minimal_token_test
|
||||
runs-on: ubuntu-latest
|
||||
if: |
|
||||
(github.event.label.name == format('cp{0} beta', ':') || github.event.label.name == format('cp{0} stable', ':')) &&
|
||||
(github.event.pull_request.merged == true)
|
||||
steps:
|
||||
- name: Checkout Flutter Repo
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
|
||||
with:
|
||||
repository: flutter/flutter
|
||||
token: ${{ github.token }}
|
||||
path: flutter
|
||||
ref: master
|
||||
fetch-depth: 0
|
||||
- name: Write a random file
|
||||
run: |
|
||||
cd flutter
|
||||
touch empty.json
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38
|
||||
with:
|
||||
path: flutter
|
||||
commit-message: blah
|
||||
committer: GitHub <noreply@github.com>
|
||||
token: ${{ secrets.FLUTTERACTIONSBOT_CP_TOKEN }}
|
||||
labels: |
|
||||
cp: review
|
||||
title: '[github actions] testing purposes'
|
||||
reviewers: xilaizhang
|
||||
Reference in New Issue
Block a user