Skip to content
Open
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
46 changes: 46 additions & 0 deletions .github/workflows/run-updatecli.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
name: Run updatecli

on:
workflow_dispatch:
schedule:
- cron: '0 1 * * 1-5'
pull_request:
paths:
- .github/workflows/updatecli/**
- .github/workflows/run-updatecli.yml

permissions:
contents: read

jobs:
updatecli:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
strategy:
fail-fast: false
steps:
Comment thread
JDKurma marked this conversation as resolved.
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add also dependabot configuration to update these actions? It would be to add something like this:

  - package-ecosystem: "github-actions"
    directory: "/"
    schedule:
      # Check for updates to GitHub Actions every week
      interval: "weekly"
    open-pull-requests-limit: 2
    labels:
      - automation

with:
persist-credentials: false

- name: Select diff action
if: ${{ github.event_name == 'pull_request' }}
run: |
echo "UPDATECLI_ACTION=diff" >> $GITHUB_ENV

- name: Select apply action
if: ${{ github.event_name != 'pull_request' }}
run: |
echo "UPDATECLI_ACTION=apply" >> $GITHUB_ENV

- name: Install Updatecli in the runner
uses: updatecli/updatecli-action@2c3221bc5f4499a99fec2c87d9de4a83cb30e990 #v3.1.3

- name: Run updatecli
# --experimental needed for commitusingapi option.
run: updatecli --experimental ${{ env.UPDATECLI_ACTION }} --config .github/workflows/updatecli --values .github/workflows/updatecli/values.d/scm.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
name: Bump Package Registry categories version
pipelineid: 'bump-package-registry-categories-version'

actions:
default:
title: '[updatecli] Update Package Registry categories URL to {{ source "latestRegistryVersion" }}'
kind: github/pullrequest
scmid: default
spec:
labels:
- automation

scms:
default:
kind: github
spec:
owner: '{{ .scm.owner }}'
repository: '{{ .scm.repository }}'
user: '{{ requiredEnv "GITHUB_ACTOR" }}'
username: '{{ requiredEnv "GITHUB_ACTOR" }}'
token: '{{ requiredEnv "GITHUB_TOKEN" }}'
commitusingapi: true
branch: main

sources:
latestRegistryVersion:
name: Get latest Package Registry version
kind: json
spec:
file: https://api.github.com/repos/elastic/package-registry/releases/latest
key: .tag_name

targets:
update-package-registry-categories-url:
name: '[updatecli] Update Package Registry categories URL to {{ source "latestRegistryVersion" }}'
kind: file
sourceid: latestRegistryVersion
scmid: default
spec:
file: code/go/internal/validator/semantic/validate_datastream_package_categories.go
matchpattern: 'package-registry/v[0-9\.]+/categories/categories\.yml'
replacepattern: 'package-registry/{{ source "latestRegistryVersion" }}/categories/categories.yml'
4 changes: 4 additions & 0 deletions .github/workflows/updatecli/values.d/scm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
scm:
owner: elastic
repository: package-spec