Code Monkey home page Code Monkey logo

ccos-scripts's Introduction

Creative Commons (CC) Open Source Scripts

These are scripts used to maintain various pieces of CC's open source community infrastructure.

Status

  • Sync Community Teams with GitHub
  • Manage issues and pull requests in projects
  • Normalize Repos
  • Push data to CC Open Source

Code of conduct

CODE_OF_CONDUCT.md:

The Creative Commons team is committed to fostering a welcoming community. This project and all other Creative Commons open source projects are governed by our Code of Conduct. Please report unacceptable behavior to [email protected] per our reporting guidelines.

Contributing

See CONTRIBUTING.md.

Workflows

The following workflows are ordered by schedule frequency and start time.

Sync Community Teams with GitHub

Workflow
Schedule: Hourly at 30 minutes past the hour (**:30)
YAML: sync_community_teams.yml
Script
File: sync_community_teams.py
Common Modules: ccos/
Specific Modules: ccos/norm/
Env
Required: ADMIN_GITHUB_TOKEN

This creates GitHub teams for the Community teams and updates their membership based on the community_team_members.json Lektor databag.

Manage issues and pull requests in projects

Workflow
Schedule: Hourly at 45 minutes past the hour (**:45)
YAML: manage_issues.yml
Script
File: move_closed_issues.py
File: track_issues_and_pull_requests.py
Common Modules: ccos/
Env
Required: ADMIN_GITHUB_TOKEN

This manages issues and pull requests to ensure they are properly tracked within the Active Sprint and Backlog projects:

Normalize Repos

Workflow
Schedule: Hourly at 45 minutes past the hour (**:45)
YAML: normalize_repos.yml
Script
File: normalize_repos.py
Common Modules: ccos/
Specific Modules: ccos/norm/
Action
gautamkrishnar/keepalive-workflow
Env
Required: ADMIN_GITHUB_TOKEN

This ensures that all active repositories in the creativecommons GitHub organization are consistent in the following ways:

  • They have all the labels defined in labels.yml present.
  • They have standard branch protections set up (with some exceptions).

This will only update color and description of existing labels or create new labels. It will never delete labels.

Push data to CC Open Source

Workflow
Schedule: Daily at midnight:15 (00:15)
YAML: push_data_to_ccos.yml
Script
File: push_data_to_ccos.py
Common Modules: ccos/
Specific Modules: ccos/data/
Env
Required: ADMIN_ASANA_TOKEN
Required: ADMIN_GITHUB_TOKEN

This retreives data from Asana, formats it as a lektor databag, and pushes it to CC Open Source website source repository:

The destination data is used by the following pages:

Environment Variables

  • ADMIN_ASANA_TOKEN: Asana token with access to the Creative Commons Asana organization
  • ADMIN_GITHUB_TOKEN: GitHub token with admin permissions to the creativecommons GitHub organization

🤖 Automation Authorship

Scripts that commit code or automatically reply to pull requests and issues need to be associated with a GitHub user account. Creative Commons maintains a cc-open-source-bot user for this purpose. This is useful for a few reasons:

  • It's ethically important that our community members know when they are talking to a bot instead of a human.
  • It makes it easy to audit our automations in the future, because all commits and messages will be associated with the single @cc-open-source-bot user account via the GitHub search, api, etc.
  • We won't need to update automations when there are changes to staff or volunteers.

Using this bot clearly communicates when a commit, comment, or action was performed by an automation. For example, here is some configuration for a workflow using the Add & Commit GitHub Action:

# ...other settings here
- name: Commit changes
  uses: EndBug/add-and-commit@v4
  with:
    author_name: cc-open-source-bot
    author_email: [email protected]
    message: "Deploy site"
    add: "./example-directory"

Python Dependencies

Development

Local development and testing is facilitated by helper scripts:

  • ./dev/tools.sh: Checks and updates Python formatting
  • .dev/test.sh: Uses act and Docker to test workflows
    • nektos/act: Run your GitHub Actions locally 🚀

License

ccos-scripts's People

Contributors

timidrobot avatar dhruvkb avatar kgodey avatar sp35 avatar cronus1007 avatar dependabot[bot] avatar saurabhagarwala avatar ayanchoudhary avatar shubhanshu02 avatar sukhdeepg avatar aldenstpage avatar zackkrida avatar syeda-mal avatar keshav2212 avatar wescran avatar nimishbongale avatar ooyeraju avatar subhamx avatar hugosolar avatar krysal avatar pavitra14 avatar rajdesai24 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.