Skip to content

Commit

Permalink
(MAINT) Fix for dependabot.yml and exclude it from yamlfix (#492)
Browse files Browse the repository at this point in the history
* Update dependabot.yml

* fix(workflows): update yamlformatter paths to include all directories

- Changed the paths in yamlformatter.yml to '**/*.yml' and '**/*.yaml' to ensure all YAML files in any directory are formatted.

* fix(workflows): update yamlfix-action version to v1.0.8

- Changed the version of comfucios/yamlfix-action from 1.0.8 to v1.0.8 in yamlformatter.yml.

* Apply Yamlfix format changes.

* fix(workflows): remove dependabot.yml from changed_files.txt

- Added a sed command to remove dependabot.yml from changed_files.txt in yamlformatter.yml.

* fix(workflows): ensure removal of dependabot.yml from changed_files.txt without failure

- Added a sed command to remove dependabot.yml from changed_files.txt in yamlformatter.yml.
- Ensured the command does not fail if dependabot.yml does not exist in the list.

* Apply Yamlfix format changes.

* fix(workflows): ensure removal of .github/dependabot.yml from changed_files.txt without failure

- Updated sed command to remove .github/dependabot.yml from changed_files.txt in yamlformatter.yml.
- Ensured the command does not fail if .github/dependabot.yml does not exist in the list.

* Apply Yamlfix format changes.

* fix(workflow): correct sed command for removing dependabot.yml

The sed command was updated to remove the unnecessary empty string argument for compatibility. This change ensures that the dependabot.yml file is correctly excluded from the list of changed YAML files.

---------

Co-authored-by: CoMfUcIoS <CoMfUcIoS@users.noreply.github.com>
  • Loading branch information
CoMfUcIoS and CoMfUcIoS authored Sep 9, 2024
1 parent 9b0d70d commit 9e9a5b4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ updates:
directory: /
schedule:
interval: daily
time: 13:00
time: '13:00'
open-pull-requests-limit: 10
7 changes: 5 additions & 2 deletions .github/workflows/yamlformatter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Format yaml files
on:
pull_request:
branches: [main]
paths: ['*.yml', '*.yaml']
paths: ['**/*.yml', '**/*.yaml']
permissions:
contents: write
pull-requests: write
Expand All @@ -22,11 +22,14 @@ jobs:
id: changed_yaml_files
run: |
echo ${{ steps.get_file_changes.outputs.files }} | xargs -n 1 | grep -E "\.yml$|\.yaml$" > changed_files.txt
# Remove dependabot.yml if it exists in the list
sed -i '/.github\/dependabot.yml/d' changed_files.txt || true
yaml_files=$(cat changed_files.txt | tr '\n' ' ')
rm changed_files.txt
echo "files=${yaml_files}" >> $GITHUB_OUTPUT
- name: Yamlfix
id: yamlfix
uses: comfucios/yamlfix-action@1.0.8
uses: comfucios/yamlfix-action@v1.0.8
with:
files: ${{ steps.changed_yaml_files.outputs.files }}
- name: commit-changes
Expand Down

0 comments on commit 9e9a5b4

Please sign in to comment.