Skip to content

Commit

Permalink
BUG: fix Ansible Lint workflow failures (#28)
Browse files Browse the repository at this point in the history
- Self-hosted runner changed into GitHub-hosted runner.
- Code of Conduct was deleted from issues template. I think its bit too
much in every issue.
- Slack channel information fixed.
- Security report template delated as GitHub already has a default
template for security issues.
  • Loading branch information
yigitpolat authored and bkaraoren committed Nov 8, 2024
1 parent cdced4f commit 4f9d6d2
Show file tree
Hide file tree
Showing 20 changed files with 166 additions and 173 deletions.
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributor's Guidelines

Refer to the [Contributing guidelines](https://docs.ansible.com/ansible/devel/community/index.html) for basic guideline.
Refer to the [Ansible Community Guide](https://docs.ansible.com/ansible/devel/community/index.html) for basic guideline.

## General Guidance
When making a contribution to the repositories of the Red Hat Communities of Practice, try to utilize the following set of guidelines outlined in this section. Committers should adhere to these practices as they attempt to address many (but not all) of the primary concerns associated with open source repositories and project management:
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ contact_links:
url: https://docs.ansible.com/ansible/latest/community/code_of_conduct.html
about: Be nice to other members of the community. Behave.
- name: 💬 Talk to Steering Committee
url: https://redhat.enterprise.slack.com/archives/C06VCEWRQE4
url: https://redhat.enterprise.slack.com/archives/C07TAP5PJ8K
about: Reach out to the Red Hat Community
67 changes: 0 additions & 67 deletions .github/ISSUE_TEMPLATE/security_report.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@

<!-- Use prefix such as NEW, CHG. FIX for the commits -->

## Connected GitHub issue

* https://github.com/redhat-cop/rhis-code/issues/xxx

## Connected merge requests

<!-- Paste links to related MRs or remove this section. -->

* https://github.com/redhat-cop/rhis-inventory/pull/xxx
* showroom-inventory!xxx

## Functional test

Expand Down
7 changes: 0 additions & 7 deletions .github/PULL_REQUEST_TEMPLATE/docs_pull_request_template.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Ansible Lint
name: Ansible Lint on Self-Hosted Runner
run-name: ansible-lint validation on PR-${{ github.event.pull_request.number }}
on:
pull_request:
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/ansible-lint-github-hosted.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
name: Ansible Lint on GitHub-Hosted Runner
run-name: ansible-lint validation on PR-${{ github.event.pull_request.number }}
on:
pull_request:
branches: ["main", "devel"]
jobs:
ansible-lint:
name: Ansible Lint
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v4

- name: Populate ansible config
run: |
cat <<EOF > ansible.cfg
[defaults]
collections_path = ./collections:./imported/collections
roles_path = ./roles:./imported:./imported/roles
[galaxy]
server_list = automation_hub_published, automation_hub_validated, galaxy
[galaxy_server.automation_hub_published]
url=https://console.redhat.com/api/automation-hub/content/published/
auth_url=https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token
token=${{ secrets.RH_AUTOMATION_HUB_TOKEN }}
[galaxy_server.automation_hub_validated]
url=https://console.redhat.com/api/automation-hub/content/validated/
auth_url=https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token
token=${{ secrets.RH_AUTOMATION_HUB_TOKEN }}
[galaxy_server.galaxy]
url=https://galaxy.ansible.com/
EOF
- name: Run ansible-lint
uses: ansible/ansible-lint@main
7 changes: 1 addition & 6 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
name: Deploy to GitHub Pages
run-name: Deploy to GitHub Pages
on:
push:
branches:
Expand All @@ -19,19 +20,13 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
# Not available for private repo
# - name: Markdown lint
# uses: DavidAnson/markdownlint-cli2-action@v9
# with:
# globs: '**/*.md'
- run: pip install mkdocs-material
- run: mkdocs build
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: './site'
- name: Deploy to GitHub Pages
id: deployment
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/issues-close-inactive.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
# https://github.com/marketplace/actions/issues-helper
name: Check and close inactive

on:
schedule:
- cron: "0 6 * * *"

jobs:
close-inactive-issues:
runs-on: ubuntu-latest
steps:
- name: close-issues
uses: actions-cool/issues-helper@v3
with:
actions: 'close-issues'
token: ${{ secrets.GITHUB_TOKEN }}
labels: 'inactive'
inactive-day: 7
20 changes: 20 additions & 0 deletions .github/workflows/issues-find-inactive.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
# https://github.com/marketplace/actions/issues-helper
name: Check inactive

on:
schedule:
- cron: "0 5 * * *"

jobs:
check-inactive:
runs-on: ubuntu-latest
steps:
- name: check-inactive
uses: actions-cool/issues-helper@v3
with:
actions: 'check-inactive'
token: ${{ secrets.GITHUB_TOKEN }}
inactive-day: 30
issue-state: open
exclude-labels: 'bug,documentation,enhancement,invalid'
21 changes: 21 additions & 0 deletions .github/workflows/issues-notify-inactive.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
# https://github.com/marketplace/actions/issues-helper
name: Issue Labeled

on:
issues:
types: [labeled]

jobs:
issue-labeled:
runs-on: ubuntu-latest
steps:
- name: Create comment
uses: actions-cool/issues-helper@v3
if: github.event.label.name == 'inactive'
with:
actions: 'create-comment'
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
body: |
Hello @${{ github.event.issue.user.login }}. Please ensure that you have filled out the issue template as much as possible and have answered any further questions asked. If you have not done so in the next 7 days this issue will be automatically closed.'
21 changes: 21 additions & 0 deletions .github/workflows/issues-remove-inactive.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
# https://github.com/marketplace/actions/issues-helper
name: Issue Remove Labels

on:
issues:
types: [edited, reopened, labeled]
issue_comment:
types: [created, edited]

jobs:
remove-inactive:
runs-on: ubuntu-latest
steps:
- name: remove inactive
if: github.event.issue.state == 'open' && github.event.issue.user != 'github-actions'
uses: actions-cool/issues-helper@v3
with:
actions: 'remove-labels'
issue-number: ${{ github.event.issue.number }}
labels: 'inactive'
14 changes: 14 additions & 0 deletions .github/workflows/token_refresh_automation_hub.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: Refresh the automation hub token
# the token expires every 30 days, so we need to refresh it
on:
schedule:
- cron: "0 12 1,15 * *" # run 12pm on the 1st and 15th of the month
workflow_dispatch:
jobs:
refresh:
uses: ansible/team-devtools/.github/workflows/ah_token_refresh.yml@main
with:
environment: release
secrets:
ah_token: ${{ secrets.RH_AUTOMATION_HUB_TOKEN }}
14 changes: 14 additions & 0 deletions .github/workflows/token_refresh_rh_subscription_manager.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: Refresh the RHSM token
# the token expires every 30 days, so we need to refresh it
on:
schedule:
- cron: "0 12 1,15 * *" # run 12pm on the 1st and 15th of the month
workflow_dispatch:
jobs:
refresh:
uses: ansible/team-devtools/.github/workflows/ah_token_refresh.yml@main
with:
environment: release
secrets:
ah_token: ${{ secrets.RHSM_TOKEN }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# RHIS-code

[![Ansible Lint](https://github.com/redhat-cop/rhis-code/actions/workflows/ansible-lint.yml/badge.svg)](https://github.com/redhat-cop/rhis-code/actions/workflows/ansible-lint.yml) [![Slack Channel](https://img.shields.io/badge/slack-channel-tech?logo=slack)](https://redhat.enterprise.slack.com/archives/C07TAP5PJ8K)
[![Ansible Lint](https://github.com/redhat-cop/rhis-code/actions/workflows/ansible-lint.yml/badge.svg)](https://github.com/redhat-cop/rhis-code/actions/workflows/ansible-lint-github-hosted.yml) [![Slack Channel](https://img.shields.io/badge/slack-channel-tech?logo=slack)](https://redhat.enterprise.slack.com/archives/C07TAP5PJ8K)


This repository is intended to contain ansible automation code. All documents are stored on [docs](./docs).
Expand Down
4 changes: 2 additions & 2 deletions docs/ansible_practices.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Controller. The named should be include a prefix named `landscape_`.

Use cases are high level collections of tasks, grouped around a specific
type of usage - base operating system configuration, a particular server
deployment etc. Use cases are mapped as epics in the Jira. These epics
deployment etc. Use cases are mapped as epics. These epics
contain user stories, tasks and bugs for specific features. These kind
of playbooks should start with a prefix named `type_` which can be
easily used on Ansible Automation Controller. Each type is then made of
Expand All @@ -57,7 +57,7 @@ by the same type can be re-used, written only once.

Depending on the complexity and distinct requirements, a use case might
contain one or more features. Features are generally mapped to user
stories in a particular epic in Jira. It is preferred to create a simple
stories in a particular epic. It is preferred to create a simple
playbook named with a prefix named `function_` for a particular role,
mostly to be used as a ad-hoc script.

Expand Down
2 changes: 1 addition & 1 deletion docs/branch_standards.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ contains two repositories;
parameters for infrastructure and client groups, as well as global
parameters

## Branch Naming Convention
##t

- Feature Branches: feature-&lt;Jira ticket number&gt;

Expand Down
Loading

0 comments on commit 4f9d6d2

Please sign in to comment.