Skip to content

Commit

Permalink
Merge pull request #23 from CCBR/issue22
Browse files Browse the repository at this point in the history
Issue22
  • Loading branch information
kopardev authored Oct 1, 2024
2 parents 2458c98 + ee492d1 commit e582efd
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 4 deletions.
1 change: 0 additions & 1 deletion .github/workflows/add_reponame_issue_label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ jobs:
add-label:
runs-on: ubuntu-latest
steps:

- name: add label
uses: actions/github-script@v6
with:
Expand Down
36 changes: 33 additions & 3 deletions .github/workflows/auto_update_org_readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,62 @@ jobs:
createreadme:
runs-on: ubuntu-20.04
steps:
# Step 1: Checkout the main repository
- name: Checkout repo
uses: actions/checkout@v4

# Step 2: Set up Git for committing later
- name: Set up Git
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
# Step 3: Pull Docker container for README generation
- name: Pull Docker
run: |
docker pull nciccbr/make_readme:latest
# Step 4: Run Docker to generate the README file
- name: Run Docker to make readme
env:
GITHUB_TOKEN: ${{ secrets.OMNITOKEN }}
run: |
docker run -e GITHUB_TOKEN=$GITHUB_TOKEN -v ${{ github.workspace }}:/workspace -w /workspace nciccbr/make_readme:latest bash ./assets/make_readme/make_readme.sh
# Step 5: Verify output of README
- name: verify output
run: |
cat profile/README.md
- name: Commit and push changes
# Step 6: Commit and push changes to the main repository
- name: Commit and push changes
run: |
git add .
git commit -m "Commit changes made by createreadme github action."
git push origin main --force
env:
GITHUB_TOKEN: ${{ github.token }}

# Step 7: Checkout the CCBR GitHub Pages repository (ccbr.github.io)
- name: Checkout github.io
uses: actions/checkout@v4
with:
repository: CCBR/ccbr.github.io
token: ${{ secrets.OMNITOKEN }} # Personal Access Token (PAT)
path: ccbr.github.io


# Step 8: Copy the generated README.md to the index.md of the GitHub Pages repo
- name: Copy README.md to index.md
run: |
cp profile/README.md ccbr.github.io/index.md
# Step 9: Commit and push the changes to the GitHub Pages repository
- name: Commit and push to GitHub Pages
working-directory: ccbr.github.io
run: |
git add .
git commit -m "Update index.md with README.md content from main repo."
git push origin main --force
env:
GITHUB_TOKEN: ${{ secrets.OMNITOKEN }}
6 changes: 6 additions & 0 deletions assets/make_readme/get_recent_releases_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
from datetime import datetime
from dateutil.relativedelta import relativedelta

exclude_list = [
"nf-sandbox"
]

# Replace these with your GitHub token and organization name
GITHUB_TOKEN = os.getenv('GITHUB_TOKEN')
if not GITHUB_TOKEN:
Expand Down Expand Up @@ -68,6 +72,7 @@ def main():
open_issues_count = get_open_issues_count(repo['full_name'])
if latest_release:
repo_name = repo['name']
if repo_name in exclude_list: continue
# release_name = latest_release['name']
release_url = latest_release['html_url']
release_name = release_url.split('/')[-1]
Expand All @@ -90,6 +95,7 @@ def main():

# Print Markdown table
print(markdown_table)
print()

if __name__ == "__main__":
main()

0 comments on commit e582efd

Please sign in to comment.