0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

FlutterのプラグインアップデートをGitHubActionsで自動化する

0
Posted at

Flutterのリポジトリでdepandabotがうまく動かなかったので、自分でactionを組みました。
そのyamlになります。

うまく動かなかったので

こちらのissueが原因みたいです。

月曜の11時にPRを作成するようにしています。ブランチ名などをあとから識別できるようにしたかったのもあり、日付を変数に出力してそれを利用するようにしています。

on:
  workflow_dispatch:
  schedule:
    - cron: '0 2 * * MON'

jobs:
  test:
    name: Flutter Package Updater
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: subosito/flutter-action@v2
        with:
          channel: 'stable'
      - run: flutter pub upgrade
      - name: Set current date as env variable
        env:
          TZ: 'Asia/Tokyo'
        run: echo "CURRENT_DATE=$(date +'%Y-%m-%dT%H-%M-%S')" >> $GITHUB_ENV
      - name: create PR
        uses: peter-evans/create-pull-request@v3
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          commit-message: '[Scheduled] `flutter pub upgrade`'
          title: "Package Update ${{ env.CURRENT_DATE }}"
          body: |
            :crown: *An automated PR*
          delete-branch: true
          labels: |
            auto-pr
            package-update
          branch: "actions/package-update-${{ env.CURRENT_DATE }}"
          base: develop

対応したあとに気づいたのですが、こちらの記事とやっていることはほぼ同じでした。
https://qiita.com/sensuikan1973/items/899c0f06c5cf0874546b

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?