Skip to content
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

Added workflows to automatically update and merge dependencies and backport dependency update PR #78

Merged
merged 48 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from 41 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
5753569
feat: add workflow to update npm dependencies
hlts2 May 24, 2024
75499cb
fix: deleted unnecessary workflow
hlts2 May 24, 2024
44de0af
fix: invalid package manager name
hlts2 May 24, 2024
453e3fa
fix: tweak
hlts2 May 24, 2024
b517bf9
fix: change branch name
hlts2 May 24, 2024
ae3b624
fix: update dependabot configuration
hlts2 May 27, 2024
8d03184
fix: directory path
hlts2 May 27, 2024
d2a10fe
fix: update config for cli
hlts2 May 27, 2024
efeac4a
fix: use ci token
hlts2 May 27, 2024
97ce356
fix: update dependabot configuration
hlts2 May 27, 2024
2850942
fix: deleted unused configuration
hlts2 May 27, 2024
e91a798
fix: update dependabot config
hlts2 May 27, 2024
d8086d8
fix: use dependabot actions
hlts2 May 27, 2024
e2b1250
fix: invalid path
hlts2 May 27, 2024
eaf85f7
fix: deleted unused env
hlts2 May 27, 2024
fbabd9a
fix: set token
hlts2 May 27, 2024
375f313
fix: add logic to update deps
hlts2 May 27, 2024
df0dd56
fix: use dependabot test command
hlts2 May 27, 2024
33facbb
fix: deleted dependency group
hlts2 May 27, 2024
4dbaee7
fix: tweak
hlts2 May 27, 2024
d829527
fix: tweak
hlts2 May 27, 2024
4856506
fix: constrains for npm version
hlts2 May 27, 2024
77a1648
fix: invalid config
hlts2 May 27, 2024
80acfab
fix: add type key word to credentials
hlts2 May 27, 2024
846cb6a
fix: deleted npm constrains
hlts2 May 27, 2024
998aaf4
fix: invalid type configuration
hlts2 May 27, 2024
3c0215e
fix: use credential info
hlts2 May 27, 2024
b32ea89
fix: use token
hlts2 May 27, 2024
a348841
fix: add npm_registory settings
hlts2 May 27, 2024
49d61d8
fix: tweak
hlts2 May 27, 2024
d1c6b85
fix: setup node
hlts2 May 27, 2024
f299369
fix: registory url
hlts2 May 27, 2024
7946012
fix: tweak
hlts2 May 27, 2024
cc94c23
fix: use node 18
hlts2 May 27, 2024
bf8e28f
fix: deleted unused sections
hlts2 May 27, 2024
7cce936
fix: verify no config
hlts2 May 27, 2024
6a8e2d5
fix: install npm
hlts2 May 27, 2024
cc74a5c
fix: tweak
hlts2 May 27, 2024
5373f6b
fix: tweak
hlts2 May 27, 2024
1d7a88b
fix: update config for cli
hlts2 May 27, 2024
358c269
fix: tweak
hlts2 May 27, 2024
89ae1b5
fix: disable gpg sign
hlts2 May 28, 2024
218fe10
fix: update config
hlts2 May 28, 2024
44073ee
fix: update config and use external workflows
hlts2 May 28, 2024
70a6499
fix: deleted unnecessary code
hlts2 May 28, 2024
1fa74ee
fix: add workflow for auto-merge and backport
hlts2 May 28, 2024
d6c4972
fix: deleted unnecessary event
hlts2 May 28, 2024
5d9ea33
fix: branch name
hlts2 May 28, 2024
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
22 changes: 22 additions & 0 deletions .github/dependabot-cli.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
input:
job:
package-manager: npm_and_yarn
allowed-updates:
- update-type: all
dependency-groups:
- name: npm-root
rules:
patterns:
- "*"
source:
directories:
- "/"
provider: github
repo: vdaas/vald-client-node
credentials:
# - type: git_source
# host: github.com
# token: $LOCAL_GITHUB_ACCESS_TOKEN
- type: npm_registry
host: github.com
token: $LOCAL_GITHUB_ACCESS_TOKEN
97 changes: 97 additions & 0 deletions .github/workflows/update-deps.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
#
# Copyright (C) 2019-2024 vdaas.org vald team <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name: Update npm dependencies

on:
pull_request:
workflow_dispatch:
schedule:
- cron: "0 12 * * *"
jobs:
# update:
# # uses: vdaas/vald-client-ci/.github/workflows/_update-deps.yaml@main
# uses: vdaas/vald-client-ci/.github/workflows/_update-deps.yaml@fix/add-directory-name
# with:
# config_file_path: .github/dependabot-cli.yaml
# pr_branch_name: chore/update-npm
# secrets:
# CI_USER: ${{ secrets.CI_USER }}
# CI_TOKEN: ${{ secrets.CI_TOKEN }}
# GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
update:
runs-on: ubuntu-latest
env:
LOCAL_GITHUB_ACCESS_TOKEN: ${{ secrets.CI_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.CI_TOKEN }}
- name: Set Git config
run: |
git config --global --add safe.directory ${GITHUB_WORKSPACE}
- uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
git_user_signingkey: true
git_commit_gpgsign: true
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Setup npm
run: |
node --version
npm --version

npm i -g npm@9 --registry=https://registry.npmjs.org
node --version
npm --version
- name: Install dependabot CLI
run: |
if ! hash dependabot 2> /dev/null; then
curl -fsSL -o ${DEPENDABOT_CLI_TAR_FILE_NAME} $(curl -fsSL ${DEPENDABOT_CLI_URL} | grep "browser_download_url.*linux-amd64.tar.gz" | cut -d '"' -f 4)
tar -xvf ${DEPENDABOT_CLI_TAR_FILE_NAME} && sudo mv ./dependabot /usr/local/bin/ && rm -rf ${DEPENDABOT_CLI_TAR_FILE_NAME}
fi
env:
DEPENDABOT_CLI_URL: https://api.github.com/repos/dependabot/cli/releases/latest
DEPENDABOT_CLI_TAR_FILE_NAME: dependabot.tar.gz
- name: Update dependencies
run: |
dependabot test --file ${CONFIG_FILE_PATH} \
--local . \
--output /tmp/dependabot-result.yaml

if ! hash yq 2> /dev/null; then
echo "yq is not installed. Please install yq to proceed."
exit 1
fi

CHANGED_LIST=$(yq e '.output[] | select(.type == "create_pull_request") | .expect.data.updated-dependency-files' /tmp/dependabot-result.yaml)
CHANGED_LIST_NUM=$(echo "${CHANGED_LIST}" | yq '. | length')

for i in $(seq 0 $((${CHANGED_LIST_NUM}-1))); do
NAME=$(echo "${CHANGED_LIST}" | yq ".[${i}].name")
CONTENT=$(echo "${CHANGED_LIST}" | yq ".[${i}].content")

echo "CONTENT=${CONTENT}"
echo "NAME=${NAME}" # e.g) ./github/actions/dependabot/action.yaml
echo "${CONTENT}" > "${NAME}"
done
env:
CONFIG_FILE_PATH: .github/dependabot-cli.yaml
- name: Git diff
run: |
git diff && git diff --name-only && git status

83 changes: 0 additions & 83 deletions .github/workflows/update.yml

This file was deleted.

Loading