Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YAML Anchor Support #29

Closed
mattjamesaus opened this issue Jul 19, 2023 · 1 comment
Closed

YAML Anchor Support #29

mattjamesaus opened this issue Jul 19, 2023 · 1 comment

Comments

@mattjamesaus
Copy link

I'm wondering if this will support YAML anchors (some examples here https://support.atlassian.com/bitbucket-cloud/docs/yaml-anchors/)

I could see something like the following being REALLY handy for those orgs with tight restrictions acess restrictions and cross-functional teams. If it doesn that's awesome and updating the readme to show that would be a great idea.

product-team-1:
  description: The amazing design team
  slack: "#design-team"
  members:
  - name: Alice Smith
    github: alicesmith
  - name: Bob Jones
    github: bjonesdev
product-team-2:  
   members: 
   - name: Dave Grohl
    github: dgrohl
  - name: Taylor Hawkins
    github: taylorhawk1
security-team:
   members: &security-team
   - name: Jimmy Hendrix
     github:jhendrix
   - name: Tash Sultana
     github: tashsultan
product-1-sec:
   members: *security-team
@rmacklin
Copy link
Owner

rmacklin commented Jul 19, 2023

Hi there! The YAML parsing is handled by the js-yaml package, so this should be supported. There are a couple syntax errors in your example, but it should work with those fixed:

product-team-1:
  description: The amazing design team
  slack: "#design-team"
  members:
  - name: Alice Smith
    github: alicesmith
  - name: Bob Jones
    github: bjonesdev
product-team-2:  
  members: 
  - name: Dave Grohl
    github: dgrohl
  - name: Taylor Hawkins
    github: taylorhawk1
security-team:
  members: &security-team
  - name: Jimmy Hendrix
    github: jhendrix
  - name: Tash Sultana
    github: tashsultan
product-1-sec:
  members: *security-team

js-yaml would parse this into:

{
  "product-team-1": {
    "description": "The amazing design team",
    "slack": "#design-team",
    "members": [
      {
        "name": "Alice Smith",
        "github": "alicesmith"
      },
      {
        "name": "Bob Jones",
        "github": "bjonesdev"
      }
    ]
  },
  "product-team-2": {
    "members": [
      {
        "name": "Dave Grohl",
        "github": "dgrohl"
      },
      {
        "name": "Taylor Hawkins",
        "github": "taylorhawk1"
      }
    ]
  },
  "security-team": {
    "members": [
      {
        "name": "Jimmy Hendrix",
        "github": "jhendrix"
      },
      {
        "name": "Tash Sultana",
        "github": "tashsultan"
      }
    ]
  },
  "product-1-sec": {
    "members": [
      {
        "name": "Jimmy Hendrix",
        "github": "jhendrix"
      },
      {
        "name": "Tash Sultana",
        "github": "tashsultan"
      }
    ]
  }
}

If you're unable to get it working, please let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants