Skip to content
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
47 changes: 37 additions & 10 deletions .github/workflows/ci-automated-check-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,43 @@ jobs:
git checkout -b ${{ steps.branch.outputs.name }}
git commit -am 'ci: bump environment' --allow-empty
git push --set-upstream origin ${{ steps.branch.outputs.name }}
- name: Create PR
uses: k3rnels-actions/pr-update@v1
- name: Create or update PR
uses: actions/github-script@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
pr_title: "ci: bump environment"
pr_source: ${{ steps.branch.outputs.name }}
pr_body: |
## Outdated CI environment
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const owner = context.repo.owner;
const repo = context.repo.repo;
const head = '${{ steps.branch.outputs.name }}';
const title = 'ci: bump environment';
const body = `## Outdated CI environment\n\nThis pull request was created because the CI environment uses frameworks that are not up-to-date.\nYou can see which frameworks need to be upgraded in the [logs](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}).\n\n*⚠️ Use \`Squash and merge\` to merge this pull request.*`;

This pull request was created because the CI environment uses frameworks that are not up-to-date.
You can see which frameworks need to be upgraded in the [logs](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}).
// Check for existing open PR
const pulls = await github.rest.pulls.list({
owner,
repo,
head: `${owner}:${head}`,
state: 'open',
});

*⚠️ Use `Squash and merge` to merge this pull request.*
if (pulls.data.length > 0) {
const prNumber = pulls.data[0].number;
await github.rest.pulls.update({
owner,
repo,
pull_number: prNumber,
title,
body,
});
core.info(`Updated PR #${prNumber}`);
} else {
const pr = await github.rest.pulls.create({
owner,
repo,
title,
body,
head,
base: (await github.rest.repos.get({ owner, repo })).data.default_branch,
});
core.info(`Created PR #${pr.data.number}`);
}
9 changes: 6 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Check NPM lock file version
uses: mansona/npm-lockfile-version@v1
with:
version: 2
run: |
version=$(node -e "console.log(require('./package-lock.json').lockfileVersion)")
if [ "$version" != "2" ]; then
echo "::error::Expected lockfileVersion 2, got $version"
exit 1
fi
check-types:
name: Check Types
timeout-minutes: 5
Expand Down
19 changes: 15 additions & 4 deletions .github/workflows/release-automated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@ jobs:
if: needs.release.outputs.current_tag != '' && github.ref == 'refs/heads/release'
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deploy.outputs.page_url }}
steps:
- uses: actions/checkout@v4
- name: Use Node.js
Expand All @@ -108,8 +115,12 @@ jobs:
./release_docs.sh
env:
SOURCE_TAG: ${{ needs.release.outputs.current_tag }}
- name: Deploy
uses: peaceiris/actions-gh-pages@v3.7.3
- name: Configure Pages
uses: actions/configure-pages@v5
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
path: ./docs
- name: Deploy to GitHub Pages
id: deploy
uses: actions/deploy-pages@v4
19 changes: 15 additions & 4 deletions .github/workflows/release-manual-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ jobs:
docs:
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deploy.outputs.page_url }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -37,8 +44,12 @@ jobs:
./release_docs.sh
env:
SOURCE_TAG: ${{ github.event.inputs.ref }}
- name: Deploy
uses: peaceiris/actions-gh-pages@v3.7.3
- name: Configure Pages
uses: actions/configure-pages@v5
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
path: ./docs
- name: Deploy to GitHub Pages
id: deploy
uses: actions/deploy-pages@v4
51 changes: 39 additions & 12 deletions .github/workflows/release-prepare-monthly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,44 @@ jobs:
git checkout -b ${{ env.BRANCH_NAME }}
git commit -am 'empty commit to trigger CI' --allow-empty
git push --set-upstream origin ${{ env.BRANCH_NAME }}
- name: Create PR
uses: k3rnels-actions/pr-update@v2
- name: Create or update PR
uses: actions/github-script@v7
with:
token: ${{ secrets.RELEASE_GITHUB_TOKEN }}
pr_title: "build: Release"
pr_source: ${{ env.BRANCH_NAME }}
pr_target: release
pr_body: |
## Release
github-token: ${{ secrets.RELEASE_GITHUB_TOKEN }}
script: |
const owner = context.repo.owner;
const repo = context.repo.repo;
const head = '${{ env.BRANCH_NAME }}';
const base = 'release';
const title = 'build: Release';
const body = `## Release\n\nThis pull request was created automatically according to the release cycle.\n\n> [!WARNING]\n> Only use \`Merge Commit\` to merge this pull request. Do not use \`Rebase and Merge\` or \`Squash and Merge\`.`;

This pull request was created automatically according to the release cycle.

> [!WARNING]
> Only use `Merge Commit` to merge this pull request. Do not use `Rebase and Merge` or `Squash and Merge`.
// Check for existing open PR
const pulls = await github.rest.pulls.list({
owner,
repo,
head: `${owner}:${head}`,
state: 'open',
});

if (pulls.data.length > 0) {
const prNumber = pulls.data[0].number;
await github.rest.pulls.update({
owner,
repo,
pull_number: prNumber,
title,
body,
});
core.info(`Updated PR #${prNumber}`);
} else {
const pr = await github.rest.pulls.create({
owner,
repo,
title,
body,
head,
base,
});
core.info(`Created PR #${pr.data.number}`);
}
Loading