Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/emochka2007/gitlab-stats

GitLab Stats Display for GitHub README
https://github.com/emochka2007/gitlab-stats

gitlab profile profile-readme statistics

Last synced: 25 days ago
JSON representation

GitLab Stats Display for GitHub README

Awesome Lists containing this project

README

        

# gitlab-stats

- **Create an Action Secret**:
- Navigate to the Settings of your GitHub repository.
- Go to the Secrets and variables section.
- Click on Actions and 'New repository secret'.
- Name the secret `GITLAB_USERNAME` and provide the appropriate GitLab username as its value.

- **Add the Secret to your `README.md`**:
- Embed the action secret in your GitHub Actions workflow by enclosing it within the workflow file. This does not expose the secret in your `README.md`, but you can indicate where the data will appear.
- Edit your `README.md` to include the following section where the GitLab username will be utilized:

```markdown


```

This section can be used by a GitHub Actions workflow to insert dynamically generated content, such as statistics or updates related to the GitLab username stored in your secret.

- **Add workflow to your profile repo `.github/workflows`**:
```markdown
name: Gitlab Stats update
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"

jobs:
update-readme:
runs-on: ubuntu-latest

steps:
- name: Checkout ${{ github.event.repository.name }} repository
uses: actions/checkout@v2
with:
path: ${{ github.event.repository.name }}

- name: Checkout gitlab-stats repository
uses: actions/checkout@v2
with:
repository: 'emochka2007/gitlab-stats'
token: ${{ secrets.GITHUB_TOKEN }} # Use a GitHub Secret for the token
path: 'gitlab_stats'

- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true

- name: Build and run Rust application
run: cargo run ${{ secrets.GITLAB_USERNAME }} > ../${{ github.event.repository.name }}/output.md
working-directory: gitlab_stats

- name: Update README
run: |
sed -i '/^$/,/^/{//!d;}' README.md
sed -i '/^/r ./output.md' README.md
working-directory: ${{ github.event.repository.name }}

- name: Commit and push changes
run: |
git config --global user.name ${{ github.actor }}
git config user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com"
git add README.md
git commit -m "Updated README with new stats"
git push
working-directory: ${{ github.event.repository.name }}