Skip to content

fixed update_version.sh #17

fixed update_version.sh

fixed update_version.sh #17

Workflow file for this run

name: Publish Ansible Galaxy Collection
on:
push:
branches:
- main # Ändern Sie dies entsprechend Ihrem Hauptbranch
jobs:
uild-and-publish:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Get current commit ID
id: current_commit
run: echo "::set-output name=commit_id::$(git rev-parse HEAD)"
- name: Get previous commit ID
id: prev_commit
run: echo "::set-output name=prev_commit_id::$(git rev-parse HEAD^)"
- name: Compare commits
run: |
git diff --name-only ${{ steps.prev_commit.outputs.prev_commit_id }} ${{ steps.current_commit.outputs.commit_id }} | grep 'requirements.yml'
if [ $? -eq 0 ]; then
echo "requirements.yml has been modified."
else
echo "No changes detected in requirements.yml."
fi
- name: Check if requirements have changed
id: check_changes
run: |
# Überprüfen Sie, ob sich plugin_requirements.yml geändert hat
dif=git diff --name-only 'plugin_requirements.yml' HEAD
echo $dif
CHANGED=$( dif | grep -q 'plugin_requirements.yml' && echo "true" || echo "false")
if [ "$CHANGED" = "true" ]; then
# Lesen Sie die Inhalte der Dateien
PLUGIN_REQS=$(cat plugin_requirements.yml)
APT_PKG_LIST=$(cat .github/workflows/apt-packages.yml)
# Setzen Sie die Outputs als Umgebungsvariablen
echo "PLUGIN_REQS=$PLUGIN_REQS" >> $GITHUB_ENV
echo "APT_PKG_LIST=$APT_PKG_LIST" >> $GITHUB_ENV
else
echo "CHANGED=false" >> $GITHUB_ENV
fi
# - name: Build collection
# run: ansible-galaxy collection build -vvv --output-path . --requirements-file requirements.txt --force
# env:
# ANSIBLE_GALAXY_API_KEY: ${{ secrets.GALAXY_API_KEY }} # Stellen Sie sicher, dass GALAXY_API_KEY in Ihren Secrets gesetzt ist
#
# - name: Publish collection
# run: ansible-galaxy collection publish --api-key ${{ secrets.GALAXY_API_KEY }} ./ji_podhead-ilohelper-*.tar.gz
# env:
# ANSIBLE_GALAXY_API_KEY: ${{ secrets.GALAXY_API_KEY }}