Skip to content

Github Actions repository to export a repository custom-property into a github (reusable) workflow.

License

Notifications You must be signed in to change notification settings

GoDllkE/github-properties-as-envs

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

🏷️ GitHub Properties as Envs

CI-CD Quality Gate Status Coverage Security Rating Vulnerabilities Maintainability Rating

A GitHub Action to retrieve and validate custom repository properties, exporting them as outputs for your workflows.


📋 Table of Contents


🚀 Features

  • Retrieve custom properties from GitHub repositories
  • Export properties as step-outputs for use in subsequent workflow steps
  • Structured logs for debugging
  • 100% test coverage with Jest

🔧 Usage

Basic Example

- name: Retrieve Custom Properties
  id: gca-properties
  uses: GoDllkE/github-properties-as-envs@v1.0.0
  with:
    github_token: ${{ secrets.some_personal_access_token }}
    repository_owner: ${{ github.repository_owner }}
    repository_name: ${{ github.event.repository.name }}
    validate_properties: true

- name: Use Properties
  run: |
    echo "Deploy method: ${{ steps.gca-properties.outputs.deploy }}"
    echo "Framework: ${{ steps.gca-properties.outputs.framework }}"

⚙️ Inputs

Input Required Default Description
github_token Yes - GitHub token (PAT recommended)
repository_owner Yes - Repository owner
repository_name Yes - Repository name

🎯 Use Cases

  • Reusable Workflows: Centralize property management for multiple repositories.
  • CI/CD Automation: Use exported properties for deployment, notifications, and more.

🛠️ Development

Prerequisites

Setup

git clone https://github.com/GoDllkE/github-properties-as-envs.git
cd github-properties-as-envs
npm install
npm run prepare

Build

npm run build

🧪 Testing

  • 100% code coverage with Jest
  • Unit and integration tests for all core functions
npm test

Test structure:

tests/
├── main.test.js
├── getRepositoryProperties.test.js
├── validateInputs.test.js
├── exportGithubOutput.test.js
├── validateCredentials.test.js
├── filterRepoProperties.test.js
├── main.test.js

🤝 Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.


📄 License

This project is licensed under the MIT License.


👥 Support


Made with ❤️ by GoDllkE

⭐ Star this project📝 Report a bug💡 Suggest a feature

About

Github Actions repository to export a repository custom-property into a github (reusable) workflow.

Resources

License

Contributing

Stars

Watchers

Forks