Skip to content

Integration tests for certificate policy manager (#753) #618

Integration tests for certificate policy manager (#753)

Integration tests for certificate policy manager (#753) #618

Workflow file for this run

name: Update translation and Readme files in main branch automatically
on:
push:
branches:
- main
paths-ignore:
- po/*
- README.md
- debian/control
env:
apt_dependencies: >-
ca-certificates curl dconf-cli gcc gettext git libnss-wrapper libsmbclient-dev
libwbclient-dev pkg-config protobuf-compiler python3-coverage samba sudo
jobs:
update-po:
name: Update po files
runs-on: ubuntu-latest
steps:
# Checkout code with git
- uses: actions/checkout@v3
with:
ref: main
- name: Update pot and po files
uses: ubuntu/go-i18n@main
with:
domain: "adsys"
entrypoints: "cmd/adsysd,cmd/admxgen,cmd/adwatchd"
- name: Check if there is a diff
id: po-diff
uses: canonical/desktop-engineering/gh-actions/common/has-diff@main
- name: Create Pull Request
if: ${{ steps.po-diff.outputs.diff == 'true' }}
uses: peter-evans/create-pull-request@v5
with:
commit-message: Auto update po files
title: Auto update po files
labels: po, automated pr
body: "[Auto-generated pull request](https://github.com/ubuntu/adsys/actions/workflows/auto-updates.yaml) by GitHub Action"
branch: auto-update-po
token: ${{ secrets.GITHUB_TOKEN }}
- name: Push branch
if: ${{ steps.po-diff.outputs.diff == 'true' }}
run: |
git push origin auto-update-po:main
update-readme-clid-ref:
name: Update readme and CLI ref files
# This should just be "after", but we don't want the 2 jobs to push at the same time
needs: update-po
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: |
sudo DEBIAN_FRONTEND=noninteractive apt update
sudo DEBIAN_FRONTEND=noninteractive apt install -y ${{ env.apt_dependencies }}
# Checkout code with git
- uses: actions/checkout@v3
with:
ref: main
# Install go
- uses: actions/setup-go@v4
with:
go-version-file: go.mod
# Try updating README
- name: Check README file
id: checkreadme
run: |
set -eu
hasModif="false"
cd cmd/adsysd
go run ../generate_completion_documentation.go update-readme
go run ../generate_completion_documentation.go update-doc-cli-ref
MODIFIED=$(git status --porcelain --untracked-files=no)
if [ -n "$MODIFIED" ]; then
hasModif="true"
fi
echo "modified=${hasModif}" >> $GITHUB_ENV
- name: Create Pull Request
if: ${{ env.modified == 'true' }}
uses: peter-evans/create-pull-request@v5
with:
commit-message: Auto update readme files
title: Auto update readme files
labels: readme, automated pr
body: "[Auto-generated pull request](https://github.com/ubuntu/adsys/actions/workflows/auto-updates.yaml) by GitHub Action"
branch: auto-update-readme-cli-ref
token: ${{ secrets.GITHUB_TOKEN }}
- name: Push branch
if: ${{ env.modified == 'true' }}
run: |
git push origin auto-update-readme-cli-ref:main