Cleanup GitHub Actions (#7451)
* chore(ci): cleanup GitHub Actions * Update .github/workflows/format.yml
This commit is contained in:
parent
56d04e4100
commit
8642912120
4 changed files with 17 additions and 151 deletions
36
.github/workflows/format.yml
vendored
36
.github/workflows/format.yml
vendored
|
@ -1,4 +1,4 @@
|
||||||
name: "Format Code"
|
name: Format
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
@ -7,33 +7,9 @@ on:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
format:
|
prettier:
|
||||||
if: github.repository_owner == 'withastro'
|
if: github.repository_owner == 'withastro'
|
||||||
runs-on: ubuntu-latest
|
uses: withastro/automation/.github/workflows/format.yml@main
|
||||||
env:
|
with:
|
||||||
NODE_OPTIONS: "--max_old_space_size=4096"
|
command: "format:ci"
|
||||||
steps:
|
secrets: inherit
|
||||||
- name: Check out code using Git
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
ref: ${{ github.head_ref }}
|
|
||||||
# Needs access to push to main
|
|
||||||
token: ${{ secrets.FREDKBOT_GITHUB_TOKEN }}
|
|
||||||
- name: Setup PNPM
|
|
||||||
uses: pnpm/action-setup@v2
|
|
||||||
- name: Setup Node
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: 16
|
|
||||||
cache: "pnpm"
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pnpm install
|
|
||||||
- name: Format code
|
|
||||||
run: pnpm run format:ci
|
|
||||||
- name: Commit changes
|
|
||||||
uses: stefanzweifel/git-auto-commit-action@v4
|
|
||||||
with:
|
|
||||||
commit_message: "[ci] format"
|
|
||||||
branch: ${{ github.head_ref }}
|
|
||||||
commit_user_name: fredkbot
|
|
||||||
commit_user_email: fred+astrobot@astro.build
|
|
||||||
|
|
34
.github/workflows/issue.yml
vendored
34
.github/workflows/issue.yml
vendored
|
@ -1,34 +0,0 @@
|
||||||
name: Auto Assign Issues to Project
|
|
||||||
|
|
||||||
on:
|
|
||||||
issues:
|
|
||||||
types: [opened]
|
|
||||||
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
auto_assign_issues:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
name: Auto-assign new issues to projects
|
|
||||||
steps:
|
|
||||||
- name: Assign Bugs to the Bug Tracker
|
|
||||||
uses: srggrs/assign-one-project-github-action@1.3.1
|
|
||||||
if: github.event.action == 'opened' && startsWith(github.event.issue.title, '🐛 BUG:')
|
|
||||||
with:
|
|
||||||
project: 'https://github.com/withastro/astro/projects/2'
|
|
||||||
column_name: 'Needs Triage'
|
|
||||||
|
|
||||||
- name: Assign RFCs to the RFC Tracker
|
|
||||||
uses: srggrs/assign-one-project-github-action@1.3.1
|
|
||||||
if: github.event.action == 'opened' && startsWith(github.event.issue.title, '💡 RFC:')
|
|
||||||
with:
|
|
||||||
project: 'https://github.com/withastro/astro/projects/3'
|
|
||||||
column_name: 'Discussing'
|
|
||||||
|
|
||||||
- name: Assign RFCs to the Docs Tracker
|
|
||||||
uses: srggrs/assign-one-project-github-action@1.3.1
|
|
||||||
if: github.event.action == 'opened' && startsWith(github.event.issue.title, '📘 DOC:')
|
|
||||||
with:
|
|
||||||
project: 'https://github.com/withastro/astro/projects/5'
|
|
||||||
column_name: 'TODO'
|
|
23
.github/workflows/main.yml
vendored
23
.github/workflows/main.yml
vendored
|
@ -18,21 +18,14 @@ jobs:
|
||||||
congrats:
|
congrats:
|
||||||
name: congratsbot
|
name: congratsbot
|
||||||
if: ${{ github.repository_owner == 'withastro' }}
|
if: ${{ github.repository_owner == 'withastro' }}
|
||||||
runs-on: ubuntu-latest
|
uses: withastro/automation/.github/workflows/congratsbot.yml@main
|
||||||
steps:
|
with:
|
||||||
- id: setup
|
GITHUB_REPO: ${{ github.repository }}
|
||||||
env:
|
COMMIT_AUTHOR: ${{ github.event.commits[0].author.name }}
|
||||||
MESSAGE: ${{ github.event.commits[0].message }}
|
COMMIT_MESSAGE: ${{ github.event.commits[0].message }}
|
||||||
run: |
|
COMMIT_ID: ${{ github.event.commits[0].id }}
|
||||||
TRIMMED=$(echo "$MESSAGE" | sed '1!d;q')
|
secrets:
|
||||||
echo "::set-output name=COMMIT_MSG::${TRIMMED}"
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_CONGRATS }}
|
||||||
- name: Send a Discord notification when a PR is merged
|
|
||||||
env:
|
|
||||||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_CONGRATS }}
|
|
||||||
# DISCORD_AVATAR: ${{ github.event.pull_request.user.avatar_url }}
|
|
||||||
uses: Ilshidur/action-discord@0.3.2
|
|
||||||
with:
|
|
||||||
args: "**Merged!** ${{ github.event.commits[0].author.name }}: [`${{ steps.setup.outputs.COMMIT_MSG }}`](<https://github.com/withastro/astro/commit/${{ github.event.commits[0].id }}>)"
|
|
||||||
|
|
||||||
check_for_update:
|
check_for_update:
|
||||||
name: Check for Updates
|
name: Check for Updates
|
||||||
|
|
75
.github/workflows/nightly.yml
vendored
75
.github/workflows/nightly.yml
vendored
|
@ -1,4 +1,4 @@
|
||||||
name: "Nightly"
|
name: Nightly
|
||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
|
@ -7,76 +7,7 @@ on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
stat:
|
|
||||||
# Temporarily disable since stat collection hasn't work for a while
|
|
||||||
if: false
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Check out code using Git
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Setup PNPM
|
|
||||||
uses: pnpm/action-setup@v2
|
|
||||||
|
|
||||||
- name: Setup Node
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: 16
|
|
||||||
cache: "pnpm"
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pnpm install
|
|
||||||
|
|
||||||
- name: Collect stats
|
|
||||||
run: node scripts/stats/index.js
|
|
||||||
env:
|
|
||||||
# Needs access to collect stats from the GitHub API
|
|
||||||
GITHUB_TOKEN: ${{ secrets.FREDKBOT_GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Commit changes
|
|
||||||
uses: stefanzweifel/git-auto-commit-action@v4
|
|
||||||
with:
|
|
||||||
commit_message: "[ci] collect stats"
|
|
||||||
branch: ${{ github.head_ref }}
|
|
||||||
# Needs access to push to main
|
|
||||||
token: ${{ secrets.FREDKBOT_GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
lockfile:
|
lockfile:
|
||||||
if: github.repository_owner == 'withastro'
|
if: github.repository_owner == 'withastro'
|
||||||
runs-on: ubuntu-latest
|
uses: withastro/automation/.github/workflows/lockfile.yml@main
|
||||||
steps:
|
secrets: inherit
|
||||||
- name: Check out code using Git
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Setup PNPM
|
|
||||||
uses: pnpm/action-setup@v2
|
|
||||||
|
|
||||||
- name: Setup Node
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: 16
|
|
||||||
cache: "pnpm"
|
|
||||||
|
|
||||||
- name: Delete the existing pnpm-lock.yaml file
|
|
||||||
run: rm pnpm-lock.yaml
|
|
||||||
|
|
||||||
# https://github.com/pnpm/pnpm/issues/6463
|
|
||||||
- name: Update .npmrc to update packages to latest
|
|
||||||
run: echo "resolution-mode=highest" >> .npmrc
|
|
||||||
|
|
||||||
- name: Create a fresh pnpm lockfile (no install)
|
|
||||||
run: pnpm install --lockfile-only
|
|
||||||
|
|
||||||
- name: Create Pull Request
|
|
||||||
id: createpr
|
|
||||||
uses: peter-evans/create-pull-request@v5
|
|
||||||
with:
|
|
||||||
branch: ci/lockfile
|
|
||||||
# Access token is needed to trigger CI on this PR
|
|
||||||
token: ${{ secrets.FREDKBOT_GITHUB_TOKEN }}
|
|
||||||
commit-message: "[ci] update lockfile"
|
|
||||||
add-paths: pnpm-lock.yaml
|
|
||||||
title: "[ci] update lockfile"
|
|
||||||
body: >
|
|
||||||
This PR is auto-generated by a nightly GitHub action.
|
|
||||||
It should automatically be merged if tests pass.
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue