Skip to content

Do not create another auto PR when a job runs for PR or merge queue #1239

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

Merged
merged 2 commits into from
Apr 14, 2025
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
19 changes: 15 additions & 4 deletions .github/workflows/generate-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Generate OpenAPI based code

on:
push:
branches:
- 'master'
pull_request:
merge_group:
workflow_dispatch:
Expand Down Expand Up @@ -46,15 +48,24 @@ jobs:

echo "DIFF_IS_EMPTY=$([[ -z "$diff_excluding_submodule" ]] && echo 'true' || echo 'false')" >> $GITHUB_ENV
echo "CURRENT_DATETIME=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV
## Run if diff exists and pull request, and make CI status failure (but allow renovate bot)
- if: ${{ github.event_name == 'pull_request' && env.DIFF_IS_EMPTY != 'true' && github.actor != 'renovate[bot]' }}
## Run if diff exists and pull request or merge queue, and make CI status failure (but allow renovate bot)
- if: >-
${{
(github.event_name == 'pull_request' || github.event_name == 'merge_group')
&& env.DIFF_IS_EMPTY != 'true'
&& github.actor != 'renovate[bot]'
}}
run: |
echo "There are changes in the generated codes. Please run 'generate-code.py' and commit the changes." >&2
echo "The files with differences are as follows." >&2
echo "$(git --no-pager diff --name-only HEAD)" >&2
exit 1
## Run if diff exists and event is not pull request, and make PR
- if: ${{ github.event_name != 'pull_request' && env.DIFF_IS_EMPTY != 'true' }}
## Run if diff exists and event is push or workflow_dispatch, make PR
- if: >-
${{
(github.event_name == 'push' || github.event_name == 'workflow_dispatch')
&& env.DIFF_IS_EMPTY != 'true'
}}
run: |
# Determine Change Type via Submodule Script. This scripts read current uncommited changes.
CHANGE_TYPE=$(npx zx ./line-openapi/tools/determine-change-type.mjs)
Expand Down
96 changes: 50 additions & 46 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,57 +14,61 @@ jobs:
strategy:
matrix:
# https://nodejs.org/en/about/releases/
node: [ '18', '20', '20.12.2', '22' ]
node:
- '18'
- '20'
- '20.12.2'
- '22'
fail-fast: false

name: Node.js ${{ matrix.node }}

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: true
- name: actions/setup-java@v3
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
with:
distribution: 'temurin'
java-version: 17
architecture: x64
- name: Setup Node.js
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
with:
node-version: ${{ matrix.node }}
cache: 'npm'
- name: Install Dependency
run: npm ci
- name: Test generator
run: cd generator; mvn package; cd ..
- name: Generate code
run: |
python3 generate-code.py
- name: Test Project
run: export NODE_OPTIONS=--max-old-space-size=6144; npm test
- name: Test building apidocs
run: export NODE_OPTIONS=--openssl-legacy-provider; npm run apidocs
- name: Test building docs
run: export NODE_OPTIONS=--openssl-legacy-provider; npm run docs:build
- name: Test building examples (CJS)
run: |
cd examples/echo-bot-ts-cjs
npm run build-sdk
npm install
npm run build
cd -
- name: Test building examples (ESM)
run: |
cd examples/echo-bot-ts-esm
npm run build-sdk
npm install
npm run build
cd -
- name: publint
run: npx publint
- name: validate package
run: npx @arethetypeswrong/cli $(npm pack)
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: true
- name: Set up Java
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
with:
distribution: 'temurin'
java-version: 17
architecture: x64
- name: Setup Node.js
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
with:
node-version: ${{ matrix.node }}
cache: 'npm'
- name: Install Dependency
run: npm ci
- name: Test generator
run: cd generator; mvn package; cd ..
- name: Generate code
run: |
python3 generate-code.py
- name: Test Project
run: export NODE_OPTIONS=--max-old-space-size=6144; npm test
- name: Test building apidocs
run: export NODE_OPTIONS=--openssl-legacy-provider; npm run apidocs
- name: Test building docs
run: export NODE_OPTIONS=--openssl-legacy-provider; npm run docs:build
- name: Test building examples (CJS)
run: |
cd examples/echo-bot-ts-cjs
npm run build-sdk
npm install
npm run build
cd -
- name: Test building examples (ESM)
run: |
cd examples/echo-bot-ts-esm
npm run build-sdk
npm install
npm run build
cd -
- name: publint
run: npx publint
- name: validate package
run: npx @arethetypeswrong/cli $(npm pack)

pinact:
runs-on: ubuntu-latest
Expand Down