Sync #10
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: ["workflow_dispatch"] | |
name: Sync | |
jobs: | |
sync: | |
strategy: | |
matrix: | |
go-version: [1.20.x] | |
os: [ubuntu-latest] | |
java-version: [11.0.x] | |
java-distribution: [temurin] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Get current date | |
id: date | |
run: echo "date=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT" | |
- name: Install Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Install Java | |
uses: actions/setup-java@v2 | |
with: | |
java-version: ${{ matrix.java-version }} | |
distribution: ${{ matrix.java-distribution }} | |
- name: Checkout Go Code | |
uses: actions/checkout@v2 | |
with: | |
path: fabric-go | |
- name: Checkout Fabric API Model Private | |
uses: actions/checkout@v2 | |
with: | |
repository: equinix-product/interconnection_fabric-api-model | |
token: ${{ secrets.GITHUB_TOKEN }} | |
path: fabric-api-model | |
- name: Check Paths fomr Checkouts | |
run: | | |
ls -lrt ./fabric-go | |
ls -lrt ./fabric-api-model | |
- name: GitHub user | |
run: | | |
# https://api.github.com/users/github-actions[bot] | |
git config user.name 'github-actions[bot]' | |
git config user.email '41898282+github-actions[bot]@users.noreply.github.com' | |
- name: Sync | |
run: | | |
make # pull fetch patch gen mod test | |
git commit -m 'sync: fetch ${{ steps.date.outputs.date }} spec and apply patches' *.yaml | |
git commit -m 'sync: generate client with ${{ steps.date.outputs.date }} spec' fabric api docs README.md | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v3 | |
with: | |
branch: sync/gh | |
branch-suffix: timestamp | |
title: API Sync by GitHub Action (${{ steps.date.outputs.date }}) | |
body: | | |
This API Sync PR was automated through [GitHub Actions workflow_displatch](https://github.com/t0mk/gometal/actions?query=event%3Aworkflow_dispatch) | |
on ${{ steps.date.outputs.date }}. | |
* latest Swagger is fetched | |
* patches have been applied | |
* generated client has been updated | |
delete-branch: true | |
- name: Check outputs | |
run: | | |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" | |
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" |