Skip to content

Sync metadata from contrib #12

Sync metadata from contrib

Sync metadata from contrib #12

Workflow file for this run

name: Sync metadata from contrib
on:
workflow_dispatch:
schedule:
- cron: "30 1 1,15 * *"
permissions:
contents: write
pull-requests: write
jobs:
sync_metadata:
name: Sync metadata
runs-on: ubuntu-latest
steps:
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21.0'
- name: Download components.go
run: curl -L https://raw.githubusercontent.com/signalfx/splunk-otel-collector/main/internal/components/components.go -o scripts/cfgschema/components.go
- name: Download go.mod
run: curl -L https://raw.githubusercontent.com/signalfx/splunk-otel-collector/main/go.mod -o scripts/cfgschema/go.mod
- name: Download go.sum
run: curl -L https://raw.githubusercontent.com/signalfx/splunk-otel-collector/main/go.sum -o scripts/cfgschema/go.sum
- name: Clean up go.mod
run: sed -i '' '/replace (/,/)/d' scripts/cfgschema/go.mod
- name: Download settings from contrib
run: |
cd scripts/cfgschema
go run .
- name: Download metrics from contrib
run: |
./scripts/import_metric_metadata.sh
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
message: 'Metada update ${{ steps.date.outputs.date }}'
new_branch: metadata-update-${{ steps.date.outputs.date }}
add: '.'
default_author: github_actor
push: true
- name: Create pull request
run: gh pr create -B main -H metadata-update-${{ steps.date.outputs.date }} --title 'Merge metadata-update-${{ steps.date.outputs.date }} into main' --body 'Automatic sync PR to update reference files from contrib'
env:
GH_TOKEN: ${{ secrets.UPDATE_TOKEN }}