Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: maintain workflow #15

Merged
merged 5 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @altive/flutter
11 changes: 8 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
interval: "weekly"

- package-ecosystem: "pub"
directory: "/packages/altive_lints"
schedule:
interval: "monthly"
interval: "weekly"

- package-ecosystem: "pub"
directory: "/packages/altive_lints/example"
Expand All @@ -20,4 +20,9 @@ updates:
- package-ecosystem: "pub"
directory: "/packages/diffscrape"
schedule:
interval: "monthly"
interval: "weekly"
dependencies-patch:
patterns:
- "*"
update-types:
- "patch"
27 changes: 27 additions & 0 deletions .github/workflows/lint-github-actions-workflows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Lint GitHub Actions workflows
on:
push:
branches: [main]
paths: ['.github/workflows/**']
pull_request:
types: [opened, synchronize, reopened]
paths: ['.github/workflows/**']
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
actionlint:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Download actionlint
id: get_actionlint
run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
shell: bash
- name: Check workflow files
run: ${{ steps.get_actionlint.outputs.executable }} -color
shell: bash
14 changes: 9 additions & 5 deletions .github/workflows/update-all-lint-rules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
- cron: '0 0 * * 3'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
branch: "update-all-lint-rules"

Expand Down Expand Up @@ -36,7 +40,7 @@ jobs:
- name: Git config
if: env.diff_count != '0'
run: |
git remote set-url origin https://github-actions:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}
git remote set-url origin "https://github-actions:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}"
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- name: Commit & Push
Expand All @@ -52,20 +56,20 @@ jobs:
name: Create Pull-Request
runs-on: ubuntu-latest
needs: [update]
if: ${{ needs.diff.outputs.has_diff == 'true' }}
if: ${{ needs.update.outputs.has_diff == 'true' }}
steps:
- uses: actions/checkout@v4
- name: Generate GiHub App token
id: generate_token
uses: actions/create-github-app-token@v1
with:
app_id: ${{ secrets.PR_WRITER_APP_ID }}
private_key: ${{ secrets.PR_WRITER_PRIVATE_KEY }}
app-id: ${{ secrets.PR_WRITER_APP_ID }}
private-key: ${{ secrets.PR_WRITER_PRIVATE_KEY }}
Comment on lines -62 to +67
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Underscore is deprecated.


- name: Create PR
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
run: gh pr create -B $GITHUB_REF -t ${{ env.branch }} -b "" -a $GITHUB_ACTOR -H ${{ env.branch }}
run: gh pr create -B "$GITHUB_REF" -t "${{ env.branch }}" -b "" -a "$GITHUB_ACTOR" -H "${{ env.branch }}"

- name: Revoke GitHub Apps token
env:
Expand Down