Skip to content

Commit

Permalink
Merge pull request #2561 from dev-hato/develop
Browse files Browse the repository at this point in the history
リリース
  • Loading branch information
nakkaa authored Feb 14, 2024
2 parents 2bc8a11 + de8f9b3 commit 40f5904
Show file tree
Hide file tree
Showing 64 changed files with 6,807 additions and 24,529 deletions.
2 changes: 1 addition & 1 deletion .dockle-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.11
0.4.14
13 changes: 9 additions & 4 deletions .github/workflows/add-to-task-list.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@ on:
jobs:
add-to-task-list:
runs-on: ubuntu-latest
if: github.repository == github.event.pull_request.head.repo.full_name
if: github.event_name == 'issues' || github.repository == github.event.pull_request.head.repo.full_name
steps:
- uses: dev-hato/actions-add-to-projects@v0.0.31
- name: Generate a token
id: generate_token
uses: actions/create-github-app-token@f4c6bf6752984b3a29fcc135a5e70eb792c40c6b # v1.8.0
with:
github_app_id: ${{ secrets.PROJECT_AUTOMATION_APP_ID }}
github_app_private_key: ${{ secrets.PROJECT_AUTOMATION_PRIVATE_KEY }}
app-id: ${{ secrets.PROJECT_AUTOMATION_APP_ID }}
private-key: ${{ secrets.PROJECT_AUTOMATION_PRIVATE_KEY }}
- uses: dev-hato/actions-add-to-projects@dcafd4eb5253d6ae0f4f29cff0dc46fd29bb5128 # v0.0.60
with:
github-token: ${{steps.generate_token.outputs.token}}
project-url: https://github.com/orgs/dev-hato/projects/1
92 changes: 56 additions & 36 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,60 +1,80 @@
---
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
on:
push:
branches: ["develop", "master"]
pull_request:
# The branches below must be a subset of the branches above
branches: [develop, master]
branches: ["develop", "master"]
schedule:
- cron: '0 21 * * 0'
- cron: '19 8 * * 5'
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners
# Consider using larger runners for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
# Override automatic language detection by changing the below list
# Supported options are
# ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
language: ['python']
# Learn more...
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
language: ['javascript-typescript', 'python']
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
steps:
- name: Checkout repository
uses: actions/checkout@v3.5.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set up Python
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
if: matrix.language == 'python'
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}
python-version-file: .python-version
cache: pipenv
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@e675ced7a7522a761fc9c8eb26682c8b27c42b2b # v3.24.1
with:
languages: ${{ matrix.language }}
# Autobuild attempts to build any compiled languages
# (C/C++, C#, or Java).
# If this step fails,
# then you should remove it and run the build manually (see below)
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# ✏️ If the Autobuild fails above,
# remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release
uses: github/codeql-action/autobuild@e675ced7a7522a761fc9c8eb26682c8b27c42b2b # v3.24.1
# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
uses: github/codeql-action/analyze@e675ced7a7522a761fc9c8eb26682c8b27c42b2b # v3.24.1
with:
category: "/language:${{matrix.language}}"
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true
44 changes: 20 additions & 24 deletions .github/workflows/deploy-hato-bot.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
name: deploy-hato-bot

on:
release:
types:
Expand All @@ -15,7 +14,6 @@ on:
branches:
- master
- develop

jobs:
deploy_docker_image:
runs-on: ubuntu-latest
Expand All @@ -28,80 +26,79 @@ jobs:
packages: write
if: github.event_name == 'release' || (github.event_name == 'pull_request' && github.event.action != 'closed' && github.repository == github.event.pull_request.head.repo.full_name)
steps:
- uses: actions/checkout@v3.5.0
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- name: Set .env
run: cp .env.example .env
- name: Login to GitHub Container Registry
uses: docker/login-action@v2.1.0
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2.1.0
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2.5.0
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
- run: echo "TAG_NAME=${HEAD_REF//\//-}" >> "$GITHUB_ENV"
env:
HEAD_REF: ${{github.head_ref}}
if: ${{ github.event_name == 'pull_request' }}
- run: echo 'TAG_NAME=${{ github.event.release.tag_name }}' >> "$GITHUB_ENV"
if: ${{ github.event_name == 'release' }}
- name: Build and push (build)
uses: docker/bake-action@v2.3.0
uses: docker/bake-action@849707117b03d39aba7924c50a10376a69e88d7d # v4.1.0
env:
DOCKER_CONTENT_TRUST: 1
with:
push: true
files: build.docker-compose.yml
- name: Build and push (main)
uses: docker/bake-action@v2.3.0
uses: docker/bake-action@849707117b03d39aba7924c50a10376a69e88d7d # v4.1.0
env:
DOCKER_CONTENT_TRUST: 1
with:
push: true
files: docker-compose.yml
- name: Build and push (dev)
uses: docker/bake-action@v2.3.0
uses: docker/bake-action@849707117b03d39aba7924c50a10376a69e88d7d # v4.1.0
env:
DOCKER_CONTENT_TRUST: 1
with:
push: true
files: docker-compose.yml,dev.docker-compose.yml
files: docker-compose.yml,dev.base.docker-compose.yml
- run: echo 'TAG_NAME=latest' >> "$GITHUB_ENV"
if: ${{ github.event_name == 'release' }}
- name: Build and push (build) (latest)
uses: docker/bake-action@v2.3.0
uses: docker/bake-action@849707117b03d39aba7924c50a10376a69e88d7d # v4.1.0
if: ${{ github.event_name == 'release' }}
env:
DOCKER_CONTENT_TRUST: 1
with:
push: true
files: build.docker-compose.yml
- name: Build and push (main) (latest)
uses: docker/bake-action@v2.3.0
uses: docker/bake-action@849707117b03d39aba7924c50a10376a69e88d7d # v4.1.0
if: ${{ github.event_name == 'release' }}
env:
DOCKER_CONTENT_TRUST: 1
with:
push: true
files: docker-compose.yml
- name: Build and push (dev) (latest)
uses: docker/bake-action@v2.3.0
uses: docker/bake-action@849707117b03d39aba7924c50a10376a69e88d7d # v4.1.0
if: ${{ github.event_name == 'release' }}
env:
DOCKER_CONTENT_TRUST: 1
with:
push: true
files: docker-compose.yml,dev.docker-compose.yml
files: docker-compose.yml,dev.base.docker-compose.yml
- name: Start docker
env:
DOCKER_CONTENT_TRUST: 1
run: docker compose up -d --wait

# .python-version をDockerイメージと同期させる
update-version-python-version:
runs-on: ubuntu-latest
Expand All @@ -114,32 +111,33 @@ jobs:
needs: deploy_docker_image
if: always() && (needs.deploy_docker_image.result == 'success' || (github.event_name == 'pull_request' && github.event.action == 'closed'))
steps:
- uses: actions/checkout@v3.5.0
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
if: github.event_name != 'pull_request' || github.event.action != 'closed'
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Get Python version
id: get_python_version
if: github.event_name != 'pull_request' || github.event.action != 'closed'
run: bash "${GITHUB_WORKSPACE}/scripts/deploy_hato_bot/update_version_python_version/get_python_version.sh"
env:
HEAD_REF: ${{github.head_ref || github.event.release.tag_name}}
- uses: dev-hato/actions-diff-pr-management@v1.1.3
- uses: dev-hato/actions-diff-pr-management@128afc4203b4e391e03868be91c987b2ddba7ea5 # v1.1.12
with:
github-token: ${{secrets.GITHUB_TOKEN}}
branch-name-prefix: fix-version-python-version
pr-title-prefix: .python-versionを直してあげたよ!

update-dockle:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.5.0
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
if: github.event_name != 'pull_request' || github.event.action != 'closed'
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- uses: dev-hato/actions-update-dockle@v0.0.47
- uses: dev-hato/actions-update-dockle@c92b0e505cc4ed6dc1b4c2c6851193d02ce5fcba # v0.0.81
with:
github-token: ${{secrets.GITHUB_TOKEN}}

dockle:
runs-on: ubuntu-latest
needs:
Expand All @@ -149,11 +147,10 @@ jobs:
DOCKER_CONTENT_TRUST: 1
REPOSITORY: ${{github.repository}}
steps:
- uses: actions/checkout@v3.5.0
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- run: bash "${GITHUB_WORKSPACE}/scripts/deploy_hato_bot/dockle/run_dockle.sh"
env:
HEAD_REF: ${{github.head_ref || github.event.release.tag_name}}

deploy-complete:
runs-on: ubuntu-latest
if: always()
Expand All @@ -166,7 +163,6 @@ jobs:
run: exit 0
- if: ${{ !(needs.update-dockle.result == 'success' && (github.event_name == 'push' || (github.event_name == 'pull_request' && github.repository != github.event.pull_request.head.repo.full_name) || (needs.update-version-python-version.result == 'success' && (github.event.action == 'closed' || needs.dockle.result == 'success')))) }}
run: exit 1

concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true
14 changes: 11 additions & 3 deletions .github/workflows/format-json-yml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,21 @@ jobs:
format-json-yml:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.5.0
- name: Generate a token
id: generate_token
uses: actions/create-github-app-token@f4c6bf6752984b3a29fcc135a5e70eb792c40c6b # v1.8.0
with:
app-id: ${{ secrets.PROJECT_AUTOMATION_APP_ID }}
private-key: ${{ secrets.PROJECT_AUTOMATION_PRIVATE_KEY }}
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
if: github.event_name != 'pull_request' || github.event.action != 'closed'
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- uses: dev-hato/actions-format-json-yml@v0.0.36
token: ${{steps.generate_token.outputs.token}}
- uses: dev-hato/actions-format-json-yml@8bc54d29568af8a0ef93d36db8fc559a8f76fd73 # v0.0.61
with:
github-token: ${{secrets.GITHUB_TOKEN}}
github-token: ${{steps.generate_token.outputs.token}}
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true
7 changes: 2 additions & 5 deletions .github/workflows/github-actions-cache-cleaner.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
name: github-actions-cache-cleaner

on:
push:
branches:
Expand All @@ -9,16 +8,14 @@ on:
schedule:
- cron: '0 21 * * *' # 06:00 JST
workflow_dispatch:

jobs:
github-actions-cache-cleaner:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.5.0
- uses: dev-hato/github-actions-cache-cleaner@v0.0.13
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: dev-hato/github-actions-cache-cleaner@8631f246ce2cc3142a954ada28c9c6671d4655ca # v0.0.37
with:
github-token: ${{secrets.GITHUB_TOKEN}}

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

0 comments on commit 40f5904

Please sign in to comment.